Internet PLC Forum
General => Technical support => Topic started by: william on October 11, 2004, 04:16:24 AM
-
I would like to display both positive and negative temperatures to one decimal place using setlcd. My code is:
A$ = STR$(A/10) +"."+STR$(ABS(A) MOD 10,1)
This works fine except for temperatures between -0.1 and -0.9 when the display is positive not negative. Any simple ideas?
-
perhaps the simplest will be to test the value of A and then add the negative sign if it is negative:
A$ = STR$(A/10) +"."+STR$(ABS(A) MOD 10,1)
IF A < 0 THEN
A$ = "-"+A$
ENDIF