Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

jbdTextField and Decimal separator

11 views
Skip to first unread message

Nicolas GASNIER

unread,
Aug 6, 2007, 5:54:23 AM8/6/07
to
Hi,
I'm facing a very annoying problem with decimal separators. The problem is
that no matter what default locale I force, dbswing expects that the decimal
separator be the comma ",", but people expect to type "." with the numeric
pad. If people type 3.14, only the 3 will be taken in consideration.
I tryied to force the field on another locale that uses the dot (en , en_us
etc...), but without any success. I tryed to force the dot in windows
regional properties, without any success. As last resort, I tryed to play a
bit with this but it has no global effect :

DecimalFormat df = (DecimalFormat)NumberFormat.getNumberInstance();
DecimalFormatSymbols symb = df.getDecimalFormatSymbols();
symb.setDecimalSeparator('.');
df.setDecimalFormatSymbols(symb);

Is there a solution to force dbswing to a least recognise the dot "." as an
alternative to the comma "," ?

Thanks


n perez

unread,
Aug 15, 2007, 6:28:07 PM8/15/07
to

I don't quite understand what you are trying to do. If you could
provide a clearer example. If i understand correctly (I don't think iI
do) One option would be to process the Text Field before
posting/processing it, ex:

TextField.getText().replaceAll("." , ",");

hth,
n perez

Nicolas GASNIER

unread,
Aug 21, 2007, 6:16:42 AM8/21/07
to
Hi,
The problem is that my system locale is fr_FR and in that locale, the "," is
the decimal separator (totally stupid imho because in practice we use the
numeric pad's dot, and the users complains about not being able to use
it...).
So I'm trying to enforce system wide (or at least component wide) the dot as
decimal separator in number processing, so that whatever the locale is, the
dot is understood in JdbTextField. That is if I type "3.14" instead of
"3,14", I want to have the value correctly converted to double/float and
stored in my dataset.


regards,
N Gasnier

"n perez" <nmp...@water.ca.gov> a écrit dans le message de news:
46c37da1$1...@newsgroups.borland.com...

0 new messages