IntelliJ Java IDE
The moose likes Java in General and the fly likes Here's a fun one.. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Here Watch "Here New topic
Author

Here's a fun one..

Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 237
I am reading a text field from a file, using it as a float value, and then storing it in an ArrayList of objects. The problem is this...
When I try using

then

On a Windows platform (or through a Windows telnet client to a Unix server), the dollar sign "$" shows up fine. On a Sun workstation on the ...SAME network, I get a "?". If you "hardcode" a "$" (or use a pattern) it shows up ok. I would think, however, that the getCurrencyinstance() method with the .format() should be the correct way to display the field....
Anyone else have this kind of problem?
Thanks...
[ February 10, 2003: Message edited by: Sam Smoot ]

CNSS/NSA Infosec Professional,<br />Software Engineer
Tim Perkuhn
Greenhorn

Joined: Jan 31, 2003
Posts: 17
Same as you described on my machines.
Because on my Windoze box i got the system propertie user.region, but not on my Sun!
Neil Laurance
Ranch Hand

Joined: Jul 18, 2002
Posts: 183
Sounds like a locale difference between your windows and UNIX platforms. I believe A US locale on your PC would cause the currency instance to use $, whilst another locale on your UNIX platform is causing the currency instance to use the generic currency symbol ¤ which may not be representable by your terminal.
Neil Laurance
Ranch Hand

Joined: Jul 18, 2002
Posts: 183
To ensure consistent behaviour, override the default locale behaviour. The NumberFormat class has two static methods to assist you:
public static java.util.Locale[] getAvailableLocales()
public static NumberFormat getInstance(java.util.Locale locale)
http://java.sun.com/j2se/1.4/docs/api/java/text/NumberFormat.html
Hope this helps
[ February 11, 2003: Message edited by: Neil Laurance ]
Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 237
I'll check it out... THanks.!
 
IntelliJ Java IDE
 
subject: Here's a fun one..
 
Threads others viewed
Logic when calling jsp page from same jsp page
Sonicall Aventail - java.exe problem
Value shows up in url
Date Displaying issue
Hudson and ssh problem someone can help me?
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture