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.
Decimal points
- Steve
- Matrix Staff
- Posts: 3422
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
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.
(this assumes your "fraction" variable can be between 0 and 99).
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