Copy link to clipboard
Copied
The value '' cannot be converted to a number
(thats 2 ' not 1 " by the way)
This appears out of the blue when i click Completed Orders on our web based point of sale software.
It occurs on the line stating:
£#NumberFormat((rstotal.subtotal + rsorders.orderpostage),'.__')#
Its extremely odd as we currently have 2 sites with exactly the same code in their POS, one works, one doesnt. :/.
This just suddenly started happening in the last few hours.
Im absolutely stumped. Originally i thought it may be because somehow the table had changed its default to NULL, but it hasnt, its exactly as it should be.
The only modifications ive made to the database are 2 CREATE TABLE query's.
Any help'd be much appreciated.
All sales need to be entered by midnight tonight otherwise the accountant is going to be pissed >_<
Copy link to clipboard
Copied
rstotal.subtotal and rsorders.orderpostage
If you output the two values involved, are they numeric or just an empty string?
Copy link to clipboard
Copied
From what i can see, the values are numeric.
Copy link to clipboard
Copied
1. Do a view source in the browser when you get the error - make sure that there really is just a space between those apostrophes, and not something else that the browser isn't rendering in the error message display.
2. Put an isNumeric() in a CFIF before the line that is getting the error, and if it fails dump out the contents of the field between two printable delimiters. maybe dump the length as well. maybe dump it in decimal, just in case there is a control character in there - maybe from a copy/paste gone bad.
-reed
Copy link to clipboard
Copied
<td><input name="searchFor" type="text" class="formInput" onclick="this.value=''" value="search for order, company, person" size="28" /></td>
Is what is returned when i ctrl+f and search for the 2 apostrophes.
Copy link to clipboard
Copied
Does the query actually return records? When I get this type of error it's because I'm looking at an empty query.
Copy link to clipboard
Copied
It returns 2 records, one of which is incomplete. (no total price and clicking on the reference number generated takes me to the admin/index.cfm page)
Copy link to clipboard
Copied
My guess is that either the subtotal or the orderpostage value is empty, and so CF is trying to add a number plus an empty string, which won't work.
Copy link to clipboard
Copied
Its quite odd. Yesterday one completed pos entry went in fine alongside an online order, then theres one line that has the total price missing, and it removes the section of background where it would be over.
Screenshot here:
http://img837.imageshack.us/img837/3528/posl.png
Copy link to clipboard
Copied
>> NumberFormat((rstotal.subtotal + rsorders.orderpostage),'.__')
There was an error, so that would make sense. If that is truly the line causing the error then one of those two values is not numeric. At least according to CF.
Did you try the previous suggestions?
ie "...Put an isNumeric() in a CFIF before the line that is getting the error, and if it fails dump out the contents of the field between two printable delimiters..."
Copy link to clipboard
Copied
Well i removed the line and now it works, but doesnt calculate a total.
And Isnumeric doesnt seem to be recognised. It just seems like its ignored.