
-----------------------------------
josh_65665
Mon Sep 15, 2008 12:02 pm

Some help with real varibles...
-----------------------------------
Lets say i have a varible thats a real right but i dont want it to be long like for example i want 12554.56 instead of 12554.562342534

is there a way to get rid of extra digits

-----------------------------------
Tony
Mon Sep 15, 2008 12:19 pm

RE:Some help with real varibles...
-----------------------------------
round()

-----------------------------------
The_Bean
Mon Sep 15, 2008 5:14 pm

Re: Some help with real varibles...
-----------------------------------
I you really want to "get rid" of extra numbers you can convert to a string, find the decimal position then cut off anything past 2 places after the decimal then convert back to real.

An easier method would be 

num:= round( num*100)/100

-----------------------------------
lordroba
Mon Sep 15, 2008 6:40 pm

Re: Some help with real varibles...
-----------------------------------
Or perhaps you mean something like this... 


var a := 12554.562342534
put a : 6 : 2


The first number is the width of the string, the second number is how many decimals you want.
