tracker issue : CF-4198258

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

Not all numbers have the same member functions

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/AsDesigned

Reporter/Name(from Bugbase): James Mohler / James Mohler ()

Created: 01/11/2017

Components: Language, Member Functions

Versions: 2016

Failure Type: Others

Found In Build/Fixed In Build: 2016,0,03,300466 /

Priority/Frequency: Normal / Few users will encounter

Locale/System: English / Mac 10.11

Vote Count: 0

Problem Description:

ParagraphFormat() does not work on all numbers

Steps to Reproduce:

<cfset NumberString = 1>	

<!--- This works --->
<cfoutput>#NumberString.paragraphFormat()#</cfoutput>	



<cfset mystring = "Hello World "><!--- Yes there is a space there --->

<cfset NumberString = mystring.len()>	
<!--- This crashes --->
<cftry>
	<cfoutput>#NumberString.paragraphFormat()#</cfoutput>	
<cfcatch><cfdump var="#cfcatch#"></cfcatch>
</cftry>


Actual Result:

Crash when using variable that was set by len()

Expected Result:

Nice paragraphformat of a number

Any Workarounds:

Not use member functions

Attachments:

Comments:

Here are some more examples <cfset arData = [1,2,3,4]> #arData.max().paragraphFormat()# #arData.min().paragraphFormat()# #arData.max().xmlFormat()# #arData.min().xmlFormat()# #arData.max().canonicalize()# #arData.min().lcase()# #arData.sum().paragraphFormat()#
Comment by James M.
1349 | January 12, 2017 12:29:08 AM GMT
Works as designed. When using <cfset NumberString = mystr.len()>, it takes NumberString as integer. Hence, only numeric methods are availble for this. If paragraphFormat() or any string method is to be used, ToString() should be called first. <cfoutput>#NumberString.tostring().paragraphFormat()#</cfoutput>
Comment by Nikhil D.
1350 | August 01, 2017 02:30:36 PM GMT
Hi Adobe, Since this is fixed in Aether (numeric data type is preserved and has string member functions), can this please be changed from Closed/Withdrawn/AsDesigned to Closed/Fixed? @James, if you change `canonicalize()` to `canonicalize(true,true)`, all your examples work in Aether. Filed CF-4202935 to cover that incorrect `canonicalize()` exception. Thanks!, -Aaron
Comment by Aaron N.
29095 | June 20, 2018 05:54:53 AM GMT