Internet PLC Forum

General => Frequently Asked Questions => Topic started by: support on December 21, 2006, 03:57:51 PM

Title: How to Display Decimal Point on LCD
Post by: support on December 21, 2006, 03:57:51 PM
Although TBASIC doesn't support floating point, you can still display numeric with decimal point on the LCD easily. This will be useful if you are using fixed point arithmetic where an integer unit represent a fraction of the real number.  For example, if every unit represent 0.01 degree, then a quantity 228.66 will be represented as 22866.

To display DM[1] with two decimal places, do the following:

SETLCD 1,1, STR$(DM[1]/100)+"."+ STR$(DM[1] mod 100,2)