I came across a frustrating Coldfusion MX 6.1 bug today. When attempting to use the Round() function, my numbers were not rounding correctly. Instead of rounding up at .5, they were being rounded down. Uhh... wtf, cf?
I spent about an hour or so debugging the issue, and sadly, I still cannot say for certain what the problem was. My best guess is that one of the variables in my expression may not have been of type numeric (although it held a numeric value), which could've somehow caused Coldfusion to get confused when performing the Round() function.
After this thought entered my mind, I immediately encapsulated the expression in a Val() function and "presto!", Round() started working again and I began to reconcile my feelings towards the computer. I had wasted so much time on something so moronic that I didn't feel the need to really fish around for the exact reason WHY Round() stopped working right, I was just happy that it was over with.
Just thinking about it gives me a headache again!
Tuesday, March 18, 2008
Round()... and why I sometimes hate my life.
Posted by Russ at 11:08 PM
Labels: bugs, coldfusion, functions
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment