Answered
Value cannot be converted to a number
I can't figure out why this will not add. I have a MySQL
database with the fields "postage" and "copies" set as varchar.
copies is 29.30 and postage is 37.22. I just trying to add things using the following code:
<cfset postage = "<cfoutput>#qcases.postage#</cfoutput>">
<cfset copies = "<cfoutput>#qcases.copies#</cfoutput>">
<cfset total = total + postage + copies>
I get the error The value "37.22" cannot be converted to a number
I have tried using these methods but no luck:
<cfset total = total + #LsNumberFormat(postage)# + #LsNumberFormat(copies)#>
and
<cfset total = total + #NumberFormat(postage)# + #NumberFormat(copies)#>
and
<cfset total = total + #DecimalFormat(postage)# + #DecimalFormat(copies)#>
copies is 29.30 and postage is 37.22. I just trying to add things using the following code:
<cfset postage = "<cfoutput>#qcases.postage#</cfoutput>">
<cfset copies = "<cfoutput>#qcases.copies#</cfoutput>">
<cfset total = total + postage + copies>
I get the error The value "37.22" cannot be converted to a number
I have tried using these methods but no luck:
<cfset total = total + #LsNumberFormat(postage)# + #LsNumberFormat(copies)#>
and
<cfset total = total + #NumberFormat(postage)# + #NumberFormat(copies)#>
and
<cfset total = total + #DecimalFormat(postage)# + #DecimalFormat(copies)#>
