tags:

views:

48

answers:

1

anyone know bigdecimal in j2me midp 2.0?

actually i just want to make j2me app, which is able to compute 1 / 6. and print it as 0.1666667. just like embedded calculator in many(every) mobile phone.

i use float it prints 0.0 i use double it still prints 0.0

many thanks.

A: 

@Vuntic: yeah..., this is stupid question ever. @Matt: thx, now i know the answer referring from the link question...

just cast it to float.. (float) 1 / (float) 6

agil
Or you can use float literals, like `1.0f / 6f`.
Vuntic