LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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



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 11 10-24-2018 05:54 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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:31 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration