Article View: borland.public.jbuilder.java.language
Article #8483Re: Decimal symbol
From: John McGrath TeamB
Date: Sat, 24 Mar 2001 23:10
Date: Sat, 24 Mar 2001 23:10
38 lines
2374 bytes
2374 bytes
On Sat, 24 Mar 2001 08:28:01 +0100, icsd.jt@wanadoo.fr wrote:
> My appli work with field numeric which are decimal :
> IE quantity and price per unit ( in fact in my appli two
> BigDecimal fields )
> If the quantity is 0,5 and the price 2,32 francs the user
> must type 0 (numeirc pad) comma (keyboard alpha)
> 5 (numeric pad) return 2 (numeric pad) comma ....
> And want just the punct is recognize as the decimal
> symbol and not the comma.
If I understand you correctly, you are saying that when you enter a
comma into a field that is supposed to take a BigDecimal value, it is
interpreted as the grouping character and not the decimal character.
So if you type 1,50, you get 150 instead of 1 1/2. Is this correct?
Java does not have a BigDecimal field component. The closest thing
in both the AWT and Swing are text fields. There are many component
libraries that offer this support, so I presume that you are using
one of these. If this is correct, then which specific component are
you using?
If not, then your code must be converting the String read from the
text field into a numeric value, and the problem would be in that
code.
In either case, if you can post the code that creates the component
and/or converts the value to a BigDecimal value, then someone may be
able to see what the problem is.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.1526dafa8a21eca398a0a4@forums.borland.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!newsfeed.frii.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!209.92.40.60References:
<3ab8c07a$1_2@dnews> <3ab9aa29$1_2@dnews> <3ab9badb_2@dnews> <3abb11c3$1_1@dnews> <3abc4c66_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,c96af9e86242b92d X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-24 15:16:05 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.language Subject: Re: Decimal symbol Date: Sat, 24 Mar 2001 18:10:06 -0500 Message-ID: <MPG.1526dafa8a21eca398a0a4@forums.borland.com> References: <3ab8c07a$1_2@dnews> <3ab9aa29$1_2@dnews> <3ab9badb_2@dnews> <3abb11c3$1_1@dnews> <3abc4c66_2@dnews> X-Newsreader: MicroPlanet Gravity v2.30 NNTP-Posting-Host: 209.92.40.60 X-Trace: 24 Mar 2001 15:05:41 -0800, 209.92.40.60 Lines: 38 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!newsfeed.frii.net!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews!209.92.40.60