File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with f:convertNumber and decimals

 
Cesar Coz
Ranch Hand
Posts: 32
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to separate the decimals with this simbol --> . <-- (a dot)

im using this code



and im getting the conversion like this '200,00' using a , and not a .

does anyone know how to solve this ?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your JVM is apparently running under a spanish locale. The simple number (and date) formatting services have picked the notation appropriate for that locale, which would be "123.456.789,00" instead of the English "123,456,789.00" format. It could be worse. I think in Peru, it's more like "1234'5678'9000" and I don't recall if they use "," or "." for the decimal point.

Your options are as follows. Pick one:

1. Override the default locale for the JVM

2. Override the locale setting on the converter by including an explicit locale attribute.

3. Supply your own custom format pattern.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic