comma « decimal « Java Data Type Q&A

Home
Java Data Type Q&A
1.bigdecimal
2.biginteger
3.bit
4.Boolean
5.byte
6.Calendar
7.cast
8.character
9.Date Time
10.Date Time Format
11.decimal
12.Development
13.double
14.enum
15.float
16.hexadecimal
17.Integer
18.Number
19.Number Format
20.primitive
21.SimpleDateFormat
22.string
23.StringBuffer
24.StringBuilder
25.StringTokenizer
26.substring
27.TimeZone
Java Data Type Q&A » decimal » comma 

1. best way to parseDouble with comma as decimal separator?    stackoverflow.com

String p="1,234";
Double d=Double.valueOf(p); 
System.out.println(d);
return a error. what the besy way to get 1.234 ? better than: p=p.replaceAll(",","."); thanks a lot :)

3. Why is it such a pain to use java in a country that uses commas as decimal?    forums.oracle.com

Why is it such a pain to use java in a country that uses commas as decimal separator? A few weeks back I've asked here about the keypad decimal key. For some reason, java doesn't map the decimal key to a comma on the Portuguese (Portugal) keyboard layout. I've got no answer and I ended up using a custom plainDocument on ...

4. Comma instead of decimal point    forums.oracle.com

Thanks. Writing code internally is no problem with a dot. Will the locale of my computer determine the string output style automatically? I saw examples of using a NumberFormatter, but then I assume I have to use it every time I output to a string with each individual number. I was hoping for a more global method.

5. How to use comma instead of dot as decimal seperator    forums.oracle.com

Hi, In my application, there is a field "currency" and i had to ensure that the value entered in currency field is always "numeric". I did this by checking for "NumberFormatException" when the value is parsed. This is not working when the currency is entered as 22,21 instead of 22.21, as is done in some countries,i.e, comma is used instead of ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.