LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   does java Locale.getDefault() work for you ? (https://www.linuxquestions.org/questions/programming-9/does-java-locale-getdefault-work-for-you-133774/)

dave bean 01-11-2004 03:46 PM

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

Looking_Lost 01-12-2004 06:13 AM

Yup, it does.


All times are GMT -5. The time now is 07:16 AM.