Article View: borland.public.jbuilder.java.api
Article #662Re: int or float
From: Kevin Dean
Date: Thu, 10 Apr 2003 18:06
Date: Thu, 10 Apr 2003 18:06
27 lines
1783 bytes
1783 bytes
If all you're looking for is a fractional part, then:
boolean isFloatingPoint = s.indexOf('.') != -1;
If you're worried about the size of the number and whether or not it will
fit into an int, that's another issue, but the above code should take care
of most cases.
--
Check out our latest white papers at
http://www.datadevelopment.com/papers/index.html
BladeNET Scores With Borland Enterprise Tools
Team Development with JBuilder and Borland Enterprise Server
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
"RaynorPao" <RaynorPao.nospam@nospam.pchome.com.tw> wrote in message
news:3e959322@newsgroups.borland.com...
> Hi all:
>
> How can I determine a string is integer or floating?
>
> Thanks.
> RaynorPao.
>
>
Technical Details
Message-ID:
<3e95b32b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3e959322@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-10 11:09:46 PST From: "Kevin Dean" <NkOdSePaAnM@datadevelopment.com> Newsgroups: borland.public.jbuilder.java.api References: <3e959322@newsgroups.borland.com> Subject: Re: int or float Date: Thu, 10 Apr 2003 14:06:23 -0400 Lines: 29 Organization: Dolphin Data Development Ltd. 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.57.150.243 Message-ID: <3e95b32b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1049998123 24.57.150.243 (10 Apr 2003 11:08:43 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.news2me.com!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