LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 01-11-2004, 03:46 PM   #1
dave bean
Member
 
Registered: Jun 2003
Location: UK
Distribution: Slackware 9.1
Posts: 136

Rep: Reputation: 15
does java Locale.getDefault() work for you ?


hi

Code:
import java.util.*;
import java.text.NumberFormat;

class testPrint{
public static void main(String args[]){
double value = 5.43;
Locale defaultLocale = Locale.getDefault();
NumberFormat nf = NumberFormat.getCurrencyInstance(defaultLocale);
String formattedValue = nf.format(value);
System.out.println(formattedValue);
}
}
i live in GB and my PC is configured correctly for location etc. Yet when i run this script i get a 'u' with an accent. Would anyone mind running it for me and telling me if it works for their locale ? also is there an easier way to display a GB pound sign.

thanks
 
Old 01-12-2004, 06:13 AM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Yup, it does.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
locale: Cannot Set LC_ALL to default locale: No such file or directory. asym Linux - General 10 03-24-2013 08:35 PM
How to change the locale by setting the system default locale letdoit Slackware 6 08-18-2011 03:34 AM
Java Newbie, Locale error... lokirulez Programming 5 11-26-2005 08:55 PM
is resierfs 4 ready?, and can it work under utf8 locale ? SciYro Linux - General 4 02-02-2005 10:16 PM
Updated Java... now java apps dont work zidane2010 Linux - Software 6 05-04-2004 08:02 PM


All times are GMT -5. The time now is 06:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration