I want to obtain number in 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 of pattern ##,##,###.###
I am getting output as 2,564,484.125
while I think I should get it as 25,64,484.125
. Why?