Results 1 to 1 of 1
-
Validate/Convert a number using the current Locale()
Comma can be used as a decimal point depending upon Locale. The NumberFormat class can handle this based on the current Locale().
Java Code:NumberFormat nf = NumberFormat.getInstance(); Number n = nf.parse(((TextField)theComponent).getText()); BigDecimal aDecimal = new BigDecimal(n.doubleValue());
Similar Threads
-
Current week number method
By levent in forum New To JavaReplies: 2Last Post: 02-01-2010, 04:33 AM -
how to convert String number to int
By gabriel in forum New To JavaReplies: 5Last Post: 08-02-2009, 03:46 PM -
How to convert integer to the hexadecimal and octal number
By Java Tip in forum java.langReplies: 0Last Post: 04-06-2008, 07:40 PM -
Locale
By Java Tip in forum Java TipReplies: 0Last Post: 11-16-2007, 02:16 PM -
Help with convert a double type number
By trill in forum New To JavaReplies: 1Last Post: 08-06-2007, 08:48 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks