
-----------------------------------
MysticVegeta
Fri Nov 25, 2005 7:29 pm

Decimal Rounding
-----------------------------------
Say I want to round to the second decimal space, Is there a function for it or do I have to create on manually. 
frealstr(x : real, y : int, z : int)

-----------------------------------
wtd
Fri Nov 25, 2005 7:31 pm


-----------------------------------
Java 1.5

String.format("%.2f", someFloatNumber)

-----------------------------------
MysticVegeta
Sat Nov 26, 2005 11:29 am


-----------------------------------
what do i need to import to make it work?

-----------------------------------
MysticVegeta
Sat Nov 26, 2005 1:14 pm


-----------------------------------
Sorry The edit button is not working for me.
I am using java 1.4.2 (ready), isnt there a premade function in 1.4?

-----------------------------------
rizzix
Sat Nov 26, 2005 1:39 pm


-----------------------------------
pre 1.5 u need to do this:java.text.DecimalFormat df = new java.text.DecimalFormat("#.##");
String str_double = df.format(my_double);
