Assume that the double variable number holds the value 459.6329. What format pattern would you use to display the number as 00459.633?
Thank you.
Hi Friend,
You can use the following code:
import java.text.*; public class DecimalFormatExample{ public static void main(String args[]){ double amount = 459.6329; DecimalFormat formatter = new DecimalFormat("00000.000"); System.out.println("The Decimal Value is:"+formatter.format(amount)); } }
Thanks
Ads