fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.text.NumberFormat;
  7. import java.text.ParseException;
  8.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14.  
  15.  
  16. NumberFormat nf = NumberFormat.getInstance(Locale.FRENCH);
  17. try {
  18. nf.parse("$2.99").doubleValue();
  19. } catch (ParseException e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
Success #stdin #stdout #stderr 0.05s 4386816KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
java.text.ParseException: Unparseable number: "$2.99"
	at java.text.NumberFormat.parse(NumberFormat.java:385)
	at Ideone.main(Main.java:18)