I want to get the number in the following format:
1000 = 1,000 10000 = 10,000 100000 = 1,00,000
I tried this:
import java.text.DecimalFormat; public class StringProcessingDemo { public static void main(String[] args) { String pattern = "##,##,###.###"; DecimalFormat myFormatter = new DecimalFormat(pattern); String output = myFormatter.format(2564484.125); System.out.println(output); } }
But despite the pattern ##,##,###.### , I get the output as 2,564,484.125 , while I think I should get it as 25,64,484.125 . Why?
Mahesha999
source share