🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: decimal separator ',' or '.'

#1318
From: John McGrath [TeamB]
Date: Sat, 03 Jan 2004 23:56
24 lines
1812 bytes
On 1/3/2004 at 1:41:37 PM, Serkan wrote:

> I was using format method of a java.text.DecimalFormat object for
> formatting and Double.parseDouble for parsing

The format() method is locale-specific.
Double.parseDouble() is locale-independent.

> I had to format the numbers formatted using the current locale to
> the user and parse these numbers into doubles after the user modifies
> the data.

That sounds like you want the locale-specific methods in both cases.
For parsing, try using the parse() method from the same DecimalFormat
object that you use for formatting.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <3ff764ce$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3ff59168@newsgroups.borland.com> <3ff5f035@newsgroups.borland.com> <3ff6dace@newsgroups.borland.com> <3ff709d1$1@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-03 17:10:25 PST
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: decimal separator ',' or '.'
Newsgroups: borland.public.jbuilder.java.swing
References: <3ff59168@newsgroups.borland.com> <3ff5f035@newsgroups.borland.com> <3ff6dace@newsgroups.borland.com> <3ff709d1$1@newsgroups.borland.com>
User-Agent: XanaNews/1.15.8.5
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
NNTP-Posting-Host: 151.201.146.98
Message-ID: <3ff764ce$1@newsgroups.borland.com>
Date: 3 Jan 2004 16:56:46 -0700
X-Trace: newsgroups.borland.com 1073177806 151.201.146.98 (3 Jan 2004 16:56:46 -0700)
Lines: 24
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail