November 2, 2019
Quick Tip: After 20 years developing with ColdFusion, I finally realized numberFormat() can round.
Comments
(1)
November 2, 2019
Quick Tip: After 20 years developing with ColdFusion, I finally realized numberFormat() can round.
Newbie 49 posts
Followers: 42 people
(1)

I’ve been developing ColdFusion applications for about 20 years and sometimes I feel like I’m still learning.  On occasion it takes stumbling across a feature to realize how something works.

Consider the following code:

<cfoutput>
#NumberFormat(1.5)#
</cfoutput>

Now… some people might look at that and think, “of course it’s going to display 2.” Honestly, I had no idea. numberFormat() without a mask will round numbers. That seems strange to me, frankly, but live and learn.

Try it for yourself.

Anyone know of any other eccentricities of functions?

1 Comment
2020-03-05 02:21:26
2020-03-05 02:21:26

Embarrassingly I missed that cfdump had the abort attribute for years.

Like
(1)
Add Comment