Convert to String number with scientific format

Asked

Viewed 329 times

5

I have the following number, in scientific notation: 7.89894691515E12

I need to convert it to String, in the common format: 7898946915150

How to do this through Java?

1 answer

3


NumberFormat formatter = new DecimalFormat("###.#####");  

String f = formatter.format(d);  

You can explore the class NumberFormat for more details

Browser other questions tagged

You are not signed in. Login or sign up in order to post.