wood burning stoves 2.0*
The moose likes Java in General and the fly likes Doubt on seperators in currency format. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Doubt on seperators in currency format." Watch "Doubt on seperators in currency format." New topic
Author

Doubt on seperators in currency format.

Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Hello,

I need to format currency values that are displayed in the project I am involved with at the moment. The below code does that perfectly fine for me :-



The problem I'm facing is with the separators. I want the currency values to be formatted in '##,##,###.##' format and not '#,###,###.##'. I read on the specifications, that by default that is how numbers are formatted using patterns and if the sequence is not recognized, the remainder of the format string is ignored. IS there a possible way to get around this using DecinalFormat based formatting options?

N.B I am not looking to play with substring() and indexOf() functions......

Thanks,
Raj.
Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 230
    
    2

The format seems to be non-standard and can't be used with DecimalFormat.
There was a discussion which came up with custom formatting using regular expresson.
Indian decimal format pattern
 
jQuery in Action, 2nd edition
 
subject: Doubt on seperators in currency format.
 
Similar Threads
DecimalFormat is not setting the format for is_IS Language
formatting amount
number format
DecimalFormat Mask Help
Localized Currency formatting issue