ReReplace(Input, "[^0-9]", "", "ALL") will remove anything that is not a
number so your code becoms...

<cfset form.totalcost = #ReReplace(form.qty, "[^0-9]", "", "ALL")#
                      * #ReReplace(form.unitcost, "[^0-9]", "", "ALL")#>

--
James Smith
[EMAIL PROTECTED]

When God created France he found it so perfect that to comfort those who
couldn't live there, he created the French.

----- Original Message -----
From: "Jim Watkins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 27, 2000 3:55 AM
Subject: Comma Problem


> Below is part of a form I use to simply multiply a quantity times unit
cost.
> The problem is that when the customer keys in a comma as in 4,000 instead
of
> 4000 a multiplication error occurs.  I get an answer but it is way wrong.
> What can I do to strip the comma out???
>
>
> <tr>
> <CFIF Len(Trim(form.qty1)) AND Len(Trim(form.unitcost1))>
> <cfset form.totalcost = #form.qty# * #form.unitcost#>
> <td><input name="unitcost" value="#form.unitcost#"></td>
> </tr>
> </CFIF>
>
> --------------------------------------------------------------------------
----
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_community
or send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body.

------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_community or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to