java - Give the number digits -


i have problem:

i declare number format here example:

i have number 45.23463 , convert this:

0045.23463000000

after dots ok couse string.format("%.8f",variable); before dot?

thx afruther help

use decimalformat instance, 0 character every spot must show digit, if it's leading/trailing zero.

decimalformat df = new decimalformat("0000.00000000000"); 

then call format format number.

the javadocs decimalformat contain list of formatting symbols can use here.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -