Rounding Double in J2ME, need help

hi....i using J2me to develop scientific calc.but i have problem with rounding the double result.when using J2SE i can use DecimalFormater...is there something like that in J2ME ?tanks...
[229 byte] By [donparisa] at [2007-11-27 8:38:20]
# 1
http://www.google.fr/search?hl=en&q=using+double+with+j2me
suparenoa at 2007-7-12 20:35:58 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
i see...thanks...one more question, is CLDC 1.1 really suport double ?,and is that posible my aplication run on handphone?thanks...Message was edited by: donparis
donparisa at 2007-7-12 20:35:58 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3

1. Convert the double to a string using Double.toString(yourDouble)

2. Use yourString.substring and indexOf(yourString, ".") to get the part you need. Concatenate trailing zeros if needed.

3. Convert the resulting string to a double using Double.parseDouble(YourResultString)

The string manipulation will be different depending on whether you want to round to a certain number of decimals or a certain number of significant figures.

If you need a code segment pls supply more details, have tested this approach and it works.

Regards, Darryl

Darryl.Burkea at 2007-7-12 20:35:58 > top of Java-index,Java Mobility Forums,Java ME Technologies...