General > Frequently Asked Questions

How to Display Decimal Point on LCD

(1/1)

support:
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)


Navigation

[0] Message Index

Go to full version