Decimal points

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
sdwx72
Posts: 4
Joined: Fri Dec 01, 2006 7:32 am
Contact:

Decimal points

Post 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.

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post 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).

Post Reply