File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Regd. NumberFormat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Regd. NumberFormat" Watch "Regd. NumberFormat" New topic

Regd. NumberFormat

Balasubramani Dharmalingam
Ranch Hand

Joined: Dec 06, 2004
Posts: 116
I want to format the double number in Italian format.When i trying the following code, its truncating the decimal fields. But i want same decimal points after formating. How to get it..?



Expected output:

Thanks in advance.

Balasubramani SD,<br />SCJP 1.4,SCWCD 1.4,SCJP 5.0<br /><a href="" target="_blank" rel="nofollow"></a>
Jaap Vermeer

Joined: Apr 04, 2006
Posts: 16
That may not be possible with NumberFormat. You could therefore use
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 45292
That format may not be possible at all. A double number only has approx 15 sig fig precision, and the number you want to print out has 20 sig fig. You are losing 5 digits which the language cannot calculate.
I have never used the java.math.BigDecimal class, but it might be a useful "first port of call."

[ April 25, 2006: Message edited by: Campbell Ritchie ]
Mohammed Yousuff
Ranch Hand

Joined: Apr 18, 2006
Posts: 45
Hi i tryed this but i getting the ans 123.456.789.012,12346 . i dont know whay the remaining is not comming . if any one knows it let me know too

Regards<br /> <br />Mohammed Yousuff M N <br /> <br />Try NOT to Become a man of SUCCESS, BUT Try to Become a man of VALUE..
I agree. Here's the link:
subject: Regd. NumberFormat
It's not a secret anymore!