Page 1 of 1

Decimal points

Posted: Sun Dec 03, 2006 12:54 am
by sdwx72
Hello,

How can I get .25 - .20 = .05 to display on the LCD screen?

What I mean is, the numbers displayed with the decimal point on the LCD after a calculation is made and asked to be displayed.

Many thanks.

Posted: Mon Dec 04, 2006 11:10 am
by Steve
Flowcode cannot currently handle floating point numbers - i.e. it only understands whole numbers.

You could keep your fractinal part in a separate variable, but when printing it to the LCD display, you will need to add any leading zeros yourself, e.g.

Code: Select all

print "."
if (fraction < 10) print "0"
print fraction
(this assumes your "fraction" variable can be between 0 and 99).