Skip to content

Instantly share code, notes, and snippets.

@robjshaw
Last active December 17, 2015 14:38
Show Gist options
  • Select an option

  • Save robjshaw/5625543 to your computer and use it in GitHub Desktop.

Select an option

Save robjshaw/5625543 to your computer and use it in GitHub Desktop.
dealing with Scientific notation in deserializeJson() in Coldfusion - DRAFT
<cfset stArgumentStructure = deserializeJSON(arguments.jsonStructure) />
<cfloop collection="#stArgumentStructure#" item="argumentItem">
<cfif (isStruct(stArgumentStructure[argumentItem]))>
<!--- structure we'll loop down one level... --->
<cfloop collection="#stArgumentStructure[argumentItem]#" item="argumentItemChildren">
<cfif isNumeric(stArgumentStructure[argumentItem][argumentItemChildren])>
<cfset stArgumentStructure[argumentItem][argumentItemChildren] = trim(numberformat(stArgumentStructure[argumentItem][argumentItemChildren], '__________________________________________________________')) />
</cfif>
</cfloop>
<cfelseif isNumeric(stArgumentStructure[argumentItem])>
<cfset stArgumentStructure[argumentItem] = trim(numberformat(stArgumentStructure[argumentItem], '__________________________________________________________')) />
</cfif>
</cfloop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment