| Author |
NumberFormat
|
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
When I run the example for French Locale as mentioned http://java.sun.com/docs/books/tutorial/java/data/numberFormat.html , the output is displayed as 123�456 fr_FR rather than 345 987,246 fr_FR Why is '�' displayed?
|
Groovy
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
Are you trying to view it in the command prompt (or in Unix shell). Try to redirect the output to a file and open it using Notepad and see how it looks.
|
Mani
Quaerendo Invenietis
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
Originally posted by Mani Ram: Are you trying to view it in the command prompt (or in Unix shell). Try to redirect the output to a file and open it using Notepad and see how it looks.
Well it works when I redirect it to a file but why doesn't it work with command prompt?
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
Probably the space between 123 and 456 is not a normal space, but some special character, which the DOS prompt is unable to render properly. How does the Euro (�) symbol appear in the command prompt and how does it appear in the notepad? DOS character set is different from the ANSI character set.
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
Originally posted by Mani Ram: Probably the space between 123 and 456 is not a normal space, but some special character, which the DOS prompt is unable to render properly. How does the Euro (�) symbol appear in the command prompt and how does it appear in the notepad? DOS character set is different from the ANSI character set.
What is the Locale for Euro?
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
Try Germany (DE).
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
9.876.543,21 � de_DE
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
Originally posted by Pradeep Bhat:
And if you try to redirect it to a file and open it in notepad, you will see Is it clear now? The DOS window is incapable of displaying some ANSI characters.
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
This is what I am getting in the file
|
 |
David Harkness
Ranch Hand
Joined: Aug 07, 2003
Posts: 1646
|
|
|
Out of curiosity, have you tried switching the font you use for the command prompt or shell? Perhaps it's merely the font and not something inherent in cmd.exe itself.
|
 |
Arjun Shastry
Ranch Hand
Joined: Mar 13, 2003
Posts: 1854
|
|
|
I am getting the correct output on command prompt.I am using Lucida Console fonts on command prompt.
|
MH
|
 |
Mani Ram
Ranch Hand
Joined: Mar 11, 2002
Posts: 1140
|
|
|
I'm not getting the correct output even with Lucida Console font!
|
 |
Arjun Shastry
Ranch Hand
Joined: Mar 13, 2003
Posts: 1854
|
|
Pradeep, define locale as : rather than If you print the avaiable Locales,you will know actual values.
|
 |
Pradeep bhatt
Ranch Hand
Joined: Feb 27, 2002
Posts: 8876
|
|
Originally posted by Arjun Shastry: Pradeep, define locale as : rather than If you print the avaiable Locales,you will know actual values.
It doesn't work. Expected output What I get by using is
|
 |
David Harkness
Ranch Hand
Joined: Aug 07, 2003
Posts: 1646
|
|
|
Loocales are specified using two-letter abbreviations for language and country. You had it right the first time.
|
 |
 |
|
|
subject: NumberFormat
|
|
|