Reputation: 3
I'm trying to set an apostrophe separator for the decimal format for a fractional number with a millionth place. I am getting a malformed pattern error.
String text = ".000'000";
DecimalFormat dformat = new DecimalFormat(text);
What is the correct string to use?
Upvotes: 0
Views: 1137
Reputation: 79848
As described on http://docs.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html, you need two single quotes, one after the other. The first will be seen as an escape character.
Upvotes: 3