You would probably be better off doing something like this.
<cfset cleanNumber = rereplace(badNumber, "[^0-9\.]+", " ", "ALL")>
That will replace everything that isn't a number or a period.
-Michael
========================================
Michael Imhoff :::: www.omnicypher.com :::: icq: 10495667
[EMAIL PROTECTED] (home) :::: (320) 255-4447 (home)
[EMAIL PROTECTED] (cell) :::: (612) 247-8159 (cell)
Allaire Alliance Consulting Partner
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 08, 2000 1:35 PM
Subject: Re: Val() doesn't work like I need it to
>
> Having now read this post perhaps my answer to your last post was
> premature.
>
> You're using the wrong function.
> >From the Docs
>
> Returns a number that the beginning of a string can be converted to.
> Returns 0 if conversion is not possible.
>
> IE
>
> <cfoutput>#val(123boy)#</cfoutput>
>
> Displays as 1
>
> If you want to simply remove non allowed characters you have to do a
series
> of replaces.
>
> IE:
>
> Replace("$23.31", "$", "", "ALL")
>
> Will remove the $ sign.
>
> Replace("1,120.1", ",", "", "ALL")
>
> Will remove the comma.
>
> --Katrina
>
> ====================
> Katrina Chapman
> Consultant
> Ameriquest Mortgage
>
>
>
> Reuben King
> <reuben.king@ To: [EMAIL PROTECTED]
> sbti.com> cc:
> Subject: Val() doesn't work
like I need it to
> 05/08/00
> 10:40 AM
> Please
> respond to
> cf-talk
>
>
>
>
>
> Val("$12.31") returns 0. Val("1,120.1") returns 1.. This is starting to
> piss me off. Am I missing something here? Am I going to have to write
> a custom tag to simply convert a human-readable number into a number-
> number for insertion into an Oracle column? (Oracle's to_number() is
> just as useless, if not more so! urg.)
>
> TIA,
> -R
> --------------------------------------------------------------------------
----
>
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
>
>
>
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.