Given below the sample code :
NumberFormat nform = NumberFormat.getInstance();
String i = nform.format(3.1415926);
String j = nform.format(3);
Here, the default locale is Locale.US, Which statement is true about the output of the above code ?
1. value of i = 3.141
2. value of i = 3.1415
3. value of j = 3.00
4. value of i = 3.1416
(3) & (4)
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.