🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #666

Re: int or float

#666
From: Gillmer J. Derge [TeamB]
Date: Fri, 11 Apr 2003 14:16
18 lines
1826 bytes
"RaynorPao" <RaynorPao.nospam@nospam.pchome.com.tw> wrote in message
news:3e96c819$1@newsgroups.borland.com...
> But, I'm not sure it is OK or not.

Looks OK to me.

You could also consider using java.text.NumberFormat.  The approach would
be similar.  Get a NumberFormat instance to parse integers and another to
parse floats.  Then try each one and catch exceptions to find the invalid
values.

The advantage is that it would be a little more robust to international
variations in number formatting.  For example, "1,234" means something very
different in the United States versus Germany.  In particular, it's a valid
integer in Germany but not in the U.S.

--
Gillmer J. Derge [TeamB]
Technical Details
Message-ID: <3e96ce20$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3e959322@newsgroups.borland.com> <u65pl1rxk.fsf@ergo.no> <3e96c819$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,e40b384e2aa5f880
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2003-04-11 07:42:17 PST
From: "Gillmer J. Derge [TeamB]" <spam@gillmerderge.com>
Newsgroups: borland.public.jbuilder.java.api
References: <3e959322@newsgroups.borland.com> <u65pl1rxk.fsf@ergo.no> <3e96c819$1@newsgroups.borland.com>
Subject: Re: int or float
Date: Fri, 11 Apr 2003 10:16:27 -0400
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 24.194.39.154
Message-ID: <3e96ce20$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1050070560 24.194.39.154 (11 Apr 2003 07:16:00 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!38.144.126.75.MISMATCH!feed1.newsreader.com!newsreader.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail