rounding

Previous topic - Next topic

mikiex

Hi, is there a simple way to convert a value in glbasic
example:
2.534454 = 2.5

?

Kitty Hello

a = FORMAT$(0, 2, 2.534454)

mikiex

ahh great - that was simple :)

Kitty Hello

If you need it for calculation (not printing/writing), you can use this:

a = INTEGER(a * 100) / 100.0