Converting Exponential value to Decimal Android -
i have string in format of "6.151536e-8"
how can convert string or int 0.000000061 ?
use if want have 2 significant digits:
string str = "6.151536e-8"; bigdecimal bd = new bigdecimal(str); bd = bd.round(new mathcontext(2, roundingmode.half_up)); system.out.println(bd.toplainstring());
this prints: 0.000000062
if want round down 0.000000061 use roundingmode.down
Comments
Post a Comment