how do I convert string to a number value. I have the database field value as 1 which is of the type string. I have to convert this value 1 into number datatype and add 1 to it.
in cf if you have
<cfset charNum = "1"> <!--- string because it is in quotes --->
you can do math with any math operator
<cfset charNum = charNum+charNum>
<!--- this produces 2 --->
you can do string functions with it using the & symbol
<cfset charNum = charNum&charNum>
<!--- this will make "22" --->
<cfset charNum = charNum + 1>
<!--- this will give you 23 --->
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. -Douglas Adams (1952-2001)
Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. -Douglas Adams (1952-2001)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.