🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1308

Re: decimal separator ',' or '.'

#1308
From: Serkan
Date: Fri, 02 Jan 2004 22:39
30 lines
2240 bytes
Hi
I am not sure if this is the thing you are asking but I also had a similar
problem while I was dealing with DecimalFormat. When I
format a number using decimal format it was formatted using the current
locale but when I tried to parse back the number as a number I
was getting a number format exception.
For ex:
if I format 1000000.2
    if thousands seperator is "." and decimal seperator is "," in the
current locale(eg: Turkish) formatted number becomes 1.000.000,2 and if I
try to parse this number back using Double.parseDouble it throws a
NumberFormatException

this is non-sense in my oponion. If a library uses the locale when
formatting it should use the same locale when parsing back. So I wrote my
own number format functions, and all I can suggests you is that.
I would also like to learn if there is another way that I don't know.
Thanks for all


"Lamjed" <antispam_lamjed@lineone.net> wrote in message
news:3ff59168@newsgroups.borland.com...
> Please ,
> I have a problem to change the decimal separator from ',' to '.' in a
> BigDecimal type .
> Can you help me to do so
> Thanks
>
>
>
Technical Details
Message-ID: <3ff5f035@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!t-online.de!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3ff59168@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,c8a77c3c06d158b1
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-01-02 14:30:13 PST
From: "Serkan" <serkan@insaat.org>
Newsgroups: borland.public.jbuilder.java.swing
References: <3ff59168@newsgroups.borland.com>
Subject: Re: decimal separator ',' or '.'
Date: Sat, 3 Jan 2004 00:39:28 +0200
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
NNTP-Posting-Host: 195.174.146.35
Message-ID: <3ff5f035@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1073082421 195.174.146.35 (2 Jan 2004 14:27:01 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.bbnplanet.com!nycmny1-snf1.gtei.net!news.gtei.net!colt.net!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!t-online.de!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail