> Anyone know why I would get a value of 0 in an input text
> field when I do this against a numeric column which has a
> null in the database?
>
> <input type="text" name="testval" value="#NumberFormat("#varname#")">

ColdFusion doesn't recognize null as a value, so it converts it to an empty
string. The NumberFormat function converts the empty string to zero. That
shouldn't come too much as a surprise, because we expect the output of the
function to be numeric.

On a side note, you don't need to use so many pound signs and quotes. You
could do this instead:

<input type="text" name="testval" value="#NumberFormat(varname)#">

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to