> You mean once you've determined it's a valid string, you then want
> that string
> as a number ?
> CF is typeless, so just use it as is.
no, i mean i need to validate that the the value i pass in to that function is
a valid float. e.g. 10.00 would pass but a2.00 would not pass:
i need it to validate the value based on the criteria:
(+ or - optional, following by a mandatory 0-9 number, followed by as many
other numbers 0-9, then followed by a mandatory dot, followed by another
mandatory number, then followed by as many other optional numbers at then end)
here is my full function:
<cffunction name="isValidFloat" hint="is passed a value, and checks to ensure
it is a valid float, and either returns true or the error">
<cfargument name="value" type="any" required="true">
<!--- declare the regaulr expression set --->
<cfset var floatRegEx = "(?!^[\+|-]?[0-9]+(\.[0-9]+)$)"> <!--- allowable --->
<!--- if no error is found then it returns the length of the string plus 1
--->
<cfif refind(floatRegEx,value) neq (len(value)+1)>
<cfreturn 'Invalid Float'>
<cfelse>
<cfreturn true>
</cfif>
</cffunction>
if i pass in the value '10.00' then it is returning that it is invalid. and i
cannot work out why, if i dump out the result of the refind then it says 2 on
this value 10.00
thanks for your help
>
> --
> Tom Chiverton
> Helping to autoschediastically facilitate granular
> performance-oriented
> end-to-end out-of-the-box convergence
>
>
>
> ****************************************************
>
> This email is sent for and on behalf of Halliwells LLP.
>
> Halliwells LLP is a limited liability partnership registered in
> England and Wales under registered number OC307980 whose registered
> office address is at Halliwells LLP, 3 Hardman Square, Spinningfields,
> Manchester, M3 3EB. A list of members is available for inspection at
> the registered office. Any reference to a partner in relation to
> Halliwells LLP means a member of Halliwells LLP. Regulated by The
> Solicitors Regulation Authority.
>
> CONFIDENTIALITY
>
> This email is intended only for the use of the addressee named above
> and may be confidential or legally privileged. If you are not the
> addressee you must not read it and must not use any information
> contained in nor copy it nor inform any person other than Halliwells
> LLP or the addressee of its existence or contents. If you have
> received this email in error please delete it and notify Halliwells
> LLP IT Department on 0870 365 2500.
>
> For more information about Halliwells LLP visit www.halliwells.com.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313547
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4