Skip to main content
Participating Frequently
February 13, 2009
Question

Numeric data with decimal places getting rounded off

Hi There,
My application has been working fine with decimal values. Now, numeric value with decimals gets rounded off when I pass 70.24 and puts 70.00 in the database. The database column has a width numeric(5,2). I have found that coldfusion reference manual says we need to include "Scale" attribute to fix this by including scale = "2" in the cfqueryparam tag for CF_SQL_NUMERIC and CF_SQL_DECIMAL data types.

Do I need to include Scale at all places where I need to store decimals? How come it was working in the past without this scale attribute ? Can anybody provide me with your suggestions please?

Thanks in advance.
This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Participating Frequently
February 15, 2009
Have you tried cf_sql_float? I use that and cf_sql_integer exclusively for numeric values and have never had an issue.
Translate