Restored from previous forum. Originally posted by MrVainSCL.
Hi @ all
I searches a way to use rounded floats (add, div and more) in an app... so i have had following idea...
In order to round a value, you can use the Int() command. This command rounds the number to an integer like following example:
Code: Select all
tmp1 = Int(102.314) ; Result will be = 103
tmp2 = Int(107.241) ; Result will be = 107
Code: Select all
tmp1 = 102.314 * 100 ; Result will be = 10231.4
tmp2 = 107.241 * 100 ; Result will be = 10724.1
Code: Select all
tmp1 = Int(10231.4) ; Result will be = 10231
tmp2 = Int(10724.1) ; Result will be = 10724
Code: Select all
tmp1 = 10231 / 100 ; Result will be = 102.31
tmp2 = 10724 / 100 ; Result will be = 107.24