GLBasic forum

Main forum => GLBasic - en => Topic started by: mikiex on 2006-Apr-23

Title: rounding
Post by: mikiex on 2006-Apr-23
Hi, is there a simple way to convert a value in glbasic
example:
2.534454 = 2.5

?
Title: rounding
Post by: Kitty Hello on 2006-Apr-23
a = FORMAT$(0, 2, 2.534454)
Title: rounding
Post by: mikiex on 2006-Apr-23
ahh great - that was simple :)
Title: rounding
Post by: Kitty Hello on 2006-Apr-24
If you need it for calculation (not printing/writing), you can use this:

a = INTEGER(a * 100) / 100.0