• Post Reply Bookmark Topic Watch Topic
  • New Topic

help me  RSS feed

 
Rahul Sud
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Techies,


I am just stuck with simple problem.
The problem is suppose i have value like 12345678.00(say it can be differ).I want to convert it to 12.345.678,00 but with my approach i am getting 12.345,678.
For other values like 12345678.01 i am getting exact result 12.345.678,01.

The approach i used


Please help me or suggest me better approach.



Thanks,
Rahul
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) UseAMeaningfulSubjectLine. Do you really think "help me" tells us anything about what you're thread is about? Remember, the subject is used to pull others to it.

2) Check out DecimalFormat and its setters.
 
Hunter McMillen
Ranch Hand
Posts: 492
Firefox Browser Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like the zeros are being ignored when both of the digits after the decimal are zero. You best bet is to do what Rob suggested and use the DecimalFormat to set your formats.

Hunter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!