tracker issue : CF-4057085

select a category, or use search below
(searches all categories and all time range)
Title:

NumberFormat not producing output as per examples

| View in Tracker

Status/Resolution/Reason: Needs Review//HaveNewInfo

Reporter/Name(from Bugbase): Ricardo Russon / Ricardo Russon (Ricardo Russon)

Created: 09/16/2015

Components: Language

Versions: 10.0

Failure Type: Data Loss

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Mac 10.10 64 bit

Vote Count: 0

Problem Description:

Optional Decimal Places are not working in the NumberFormat mask.

Steps to Reproduce:

NumberFormat(-3.21,"C(_^)_")

Actual Result:

( 3)

Expected Result:

( 3.21)

Any Workarounds:

None.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4057085

External Customer Info:
External Company:  
External Customer Name: Ricardo Russon
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

ColdFusion 11 Update 6 Update Level: 06 Update Type: General Install Date: Mon, 31 Aug 2015 13:52:09 +1000
Comment by External U.
5876 | September 16, 2015 12:25:44 AM GMT
Using CF 10,0,20,299202 (Developer; Windows) I just encountered an issue with numberformat too. I don't think CF should be rounding this. I had to revert to a string function to get the expected result. <cfoutput> <cfset X = 0.99995028972626> <div>NumberFormat(X, '0.0000') = #NumberFormat(X, '0.0000')#</div> <div>Left(X,6) = #Left(X,6)#</div> </cfoutput>
Comment by External U.
5877 | September 26, 2016 09:22:15 AM GMT
This is still an issue in CF2018 / 13
Comment by Ricardo R.
30036 | December 11, 2018 04:25:15 AM GMT
It appears the docs have been updated since my original post, but the new example doesn't work either NumberFormat(-3.21,"C_(^)_") Expected : "(3.21)" Actual : "(3)"
Comment by Ricardo R.
30037 | December 11, 2018 04:33:17 AM GMT