Hello,
I am doing some programming in the Java language. In my country we use the dot (.) separator for the decimals and the comma separator for the thousands. For example the number
1,234.567 in the British locale is written as 1.234,567. When I was doing the java programming in Windows Vista Java could detect the default locale and represent and accept output/input of numbers in the right format. Now in (Linux) Mint although I changed the locale (with a process that I will describe below) Java didn't consider that and continued to use its own British locale. Only after using the NumberFormat class and the Locale object I managed to have the expected result but in Windows Vista this happened automatically. Because I don't want to switch back to Vista can you help me?
The procedure that I followed: changed the /var/lib/locales/supported.d/local by adding this line el_GR.UTF-8 UTF-8
changed the /etc/default/locale/ by modifying the variable LANG to el_GR.UTF-8 and the variable LANGUAGE to el_GR:el
run the command sudo dpkg-reconfigure locales
reboot the system
recompile my program.
The code of my program is the following:
public class Dokimi
{
public static void main(String [] args)
{
Number n = new Double(4.2);
System.out.println(n.doubleValue());
}
}
I have the same problem when I use JOptionPane showInputDialog to get input from the user. If I enter the number 4,2 instead of 4.2 I get an error.
Thanks