0

For Indian Locale grouping separator placement varies i.e. it's not fixed to appear after every 3 digits
e.g
100
1,000
10,000
1,00,000
10,00,000
1,00,00,000

I want to construct a DecimalFormat Pattern for above locale such that grouping seperators are also shown at correct places

If i specify grouping seperator in a pattern then grouping separator placement gets fixed

Patterns that i tried

##,###  -> grouping seperator is fixed to appear after every 3 digits
##,##   -> grouping seperator is fixed to appear after every 2 digits
##      -> does not show grouping seperator

Reason: Why i want to acheive this via DecimalFormat Pattern
I am using Spring MVC and wants to leverage its @NumberFormat annotation to do number formatting on my Model Fields
In this annotation,i can only specify decimal format pattern.

I am hoping this could be achieved by specifying correct decimal format pattern and i don't have to create my own Number formatter.

harrybvp
  • 2,445
  • 2
  • 22
  • 30
  • I don't know if this can be used with the Spring `@NumberFormat` annotation, but the ICU project supports an India-aware number format. Look at this SO question: http://stackoverflow.com/questions/5379231/displaying-currency-in-indian-numbering-format – Eric Jablow Jul 26 '13 at 20:27
  • You don't mess with the pattern, you set the proper locale. – Mihai Nita Sep 13 '13 at 03:55

0 Answers0