Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

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


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);
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.

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

Rep: Reputation: 45
Yup, it does.


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:54 PM.

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