0
Precision Problem with CFQUERY
Explorer
,
/t5/coldfusion-discussions/precision-problem-with-cfquery/td-p/332457
Mar 30, 2008
Mar 30, 2008
Copy link to clipboard
Copied
I have a column in Oracle which is a Number with precision
10, and scale 4.
Everytime I select anything from there from CF, it is displaying all 4 decimals.
Say the number "1" is in one record, "2.2" is in the second record, "3.0003" is in the third.
when I do a select all in a cfquery, I get:
1.0000
2.2000
3.0003
but if I were to select it in SQLPLUS, I get:
1
2.2
3.003
which is the result I desire. Why is Cold fusion adding zeros to the cfquery? And how can I fix this?
Thanks,
boybles
Everytime I select anything from there from CF, it is displaying all 4 decimals.
Say the number "1" is in one record, "2.2" is in the second record, "3.0003" is in the third.
when I do a select all in a cfquery, I get:
1.0000
2.2000
3.0003
but if I were to select it in SQLPLUS, I get:
1
2.2
3.003
which is the result I desire. Why is Cold fusion adding zeros to the cfquery? And how can I fix this?
Thanks,
boybles

TOPICS
Getting started
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

/t5/coldfusion-discussions/precision-problem-with-cfquery/m-p/332458#M30044
Mar 31, 2008
Mar 31, 2008
Copy link to clipboard
Copied
A quick and dirty workaround would be to multiply the
retrieved number by 1 - <CFSET foo = queryName.myNumber *
1>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Mentor
,
/t5/coldfusion-discussions/precision-problem-with-cfquery/m-p/332459#M30045
Mar 31, 2008
Mar 31, 2008
Copy link to clipboard
Copied
Use
#val(your_col)# to display the result as you desire in the
output. It will "convert" your numeric "string" back to a number
and drop the trailing zeros.
Phil
Phil
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Contributor
,
LATEST
/t5/coldfusion-discussions/precision-problem-with-cfquery/m-p/332460#M30046
Mar 31, 2008
Mar 31, 2008
Copy link to clipboard
Copied
Numberformat function would be helpful. 🙂
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

