Pada Fri, 28 Aug 2009 11:23:59 +0200
Fabien Bodard <gambas...@gmail.com> menulis:

> IF NOT sRain THEN
>  IF InStr(LCase(sRain), "x") > 0 OR InStr(sRain, "-") > 0 THEN
>    fRain=0
>  ELSE
>    TRY fRain = CFloat(sRain)
>    IF ERROR THEN fRain=-1  'Not a Valid Number
>  ENDIF
> ELSE
>  fRain=-1
> ENDIF

Thanks Fabien,

But First, I need to change dot to comma as decimal separator, since
the original string at the database was dot.

Does "TRY fRain = CFloat(sRain)" automatically turn into floating
number without detecting localization ?

My latest code was working, so I didn't touch it again. But looks like
yours more simpler and efficient :D

-- 
Cheers,
[-Sulchan-]
Terbang dengan claws-mail 3.7.2
Mendarat di hardy heron 8.04.3 LTS

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to