aspose file tools*
The moose likes Beginning Java and the fly likes Number Format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Number Format" Watch "Number Format" New topic
Author

Number Format

sridhar chenn
Greenhorn

Joined: Mar 19, 2003
Posts: 2
hi can u help me out in extending the number format to INR rep.
1,25,000.00 for one lakh, 25 thou...
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, sridhar!
According to The DecimalFormat Class Documentation:
The grouping size is a constant number of digits between the grouping characters, such as 3 for 100,000,000 or 4 for 1,0000,0000. If you supply a pattern with multiple grouping characters, the interval between the last one and the end of the integer is the one that is used. So "#,##,###,####" == "######,####" == "##,####,####".
So, you cannot have varying grouping sizes.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Of course, writing your own number formatter should be pretty simple. Want to give it a try?
 
Consider Paul's rocket mass heater.
 
subject: Number Format