> I haven't been able to find a function that will convert a string
> (containing only digits) to a number.
>
> Can anyone advise how to do this?

Do it like this:

<cfscript>
    bar = "1234";
    foo = bar * 1;
</script>

I use this techinque to insure that some variable is numeric and is
serialized correctly with <cfwddx> (ie it's <var
name='foo'><number>1234</number></var> not <var
name='foo'><string>1234</string></var> in the generated package).

Erki


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to