Skip to main content
Participant
June 24, 2008
Question

cfquery returning scientific notation

  • June 24, 2008
  • 1 reply
  • 591 views
I am writing a CF application that queries a Centura SQLBase DB--not my DB of choice, its an interface partner's DB! Some of the fields in the SQLBase DB are of type FLOAT, which for some reason CF is returning in scientific notation (i.e. 1.23653E7) rather than as a whole number. Additionally, CF is losing precision, so I can't even run a function against the result to convert it back to the original number.

Any ideas on how I can make CF not convert the number to scientific notation, or at least preserve the original precision?
This topic has been closed for replies.

1 reply

Participating Frequently
June 24, 2008
In reviewing the SQL Language Reference for SQLBase, it looks like there isn't a CAST() or CONVERT() function, but there is a @STRING function whose description is to "Convert a number to a string" (pg. 4-51). Perhaps you can convert your FLOAT to a string of the apprporiate length then convert that to a number in ColdFusion.

@STRING(number, scale)
This function converts a number into a string with the number of decimal places
specified by scale. Numbers are rounded where appropriate.


Phil