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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -