• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

currency format with java.text.DecimalFormat

 
Adrien Ruffie
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All I have a small problem with DecimalFormat,

I have the following code:



But the problem is that, in database I have following value: 1 000 100 003 840 , and I need to print it like : 1 000 100 003 840 €, but the "value" is a BigDecimal and print like "1.0001E+12" and after the decimalFormat.format(value) I get following result "1 000 100 000 000,00" , do you know my problem, I loose 3 840 € ...

The format variable is the following string "###,##0.00"

Do you know a solution to this problem ?

Great thank and best regards,

Adryen
 
Tony Docherty
Bartender
Posts: 2971
59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran the following code:

And the output was:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic