Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

round off problem?

Guest
Nov 07, 2011 Nov 07, 2011

A ColdFusion program is trying to store a value or 0.25 into a column of type decimal(11,6) of SQL Server table but 0.0000000 is getting stored. 0.50 is getting stored at 1.0000000. This started happenning after using cfqueryparam. Maxlength is 17.

What am I doing wrong?

814
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Nov 07, 2011 Nov 07, 2011

Without seeing your code, I would guess the CFQUERYPARM is using

cf_sql_integer instead of cf_sql_float.

Translate
Contributor ,
Nov 07, 2011 Nov 07, 2011

Without seeing your code, I would guess the CFQUERYPARM is using

cf_sql_integer instead of cf_sql_float.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Nov 07, 2011 Nov 07, 2011

Was using cf_sql_decimal. Numeric didn't workeither but float did.

Why is this?

Thank you very much.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 07, 2011 Nov 07, 2011
LATEST

Because cf_sql_decimal needs the scale="" attribute set in order to use decimal places.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources