Skip to main content
Participant
August 13, 2013
Question

Number Format $ , Conversion Error

  • August 13, 2013
  • 1 reply
  • 635 views

I have a project where I am dealing with around 200 data entry variables.   I put notices everywhere not to use punctation but folks do love to input $ and commas which of course throws the error  "Error converting data type varchar to numeric." I have tried every trick I can find but it does not catch the $ and comma entery.   This is my latest effort.   The SQL type is numeric(10,0).   What have I missed?  What am I doing wrong?   Very frustrated with this!


<cfinput type="text" name="GFA" value="#NumberFormat(GFA)#" size="9"  Message="Round to whole dollars no punctuation" ValidateAt="onsubmit" Validate="integer">

Thanks for your time. 

This topic has been closed for replies.

1 reply

p_sim
Participating Frequently
August 13, 2013

Why don't you use regular expression (regex) to remove non-numerical characters?

By the way, related to form, there is http://www.quackfuzed.com/demos/cfUniForm/

Participant
August 13, 2013

I am somwhat new and I tried to find an example of Regex to remove a comma and $ or decimal and I came up empty handed.   I found items that related but not a good example to follow.    Do you have one or can point me to one?    Thanks!  This would be great to resolve for tomorrow.  

Thanks again for helping!