tracker issue : CF-3041279

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

Bug 82623:DeserializeJSON() does not preserve BigDecimal number

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/

Reporter/Name(from Bugbase): Henry Ho / Henry Ho (Henry Ho)

Created: 04/05/2010

Components: AJAX, Plumbing

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 1

Problem:

DeserializeJSON() does not preserve BigDecimal number.  It  deserializes to float. Currently serializeJSON() and deserializeJSON() is very hard to use when large number is needed to be serialized.  To workaround the convert to float, one can use javacast("bigdecimal",num).  However, there's no workaround to deserialize the number into a bigdecimal.
Method:

<cfscript>
	x = javacast('bigDecimal',4111111111111111);
	y = serializeJSON(x);
	z = deserializeJSON(y);
	writeDump(x);
	writeoutput("<br>");
	writeDump(y);
	writeoutput("<br>");
	writeDump(z);
</cfscript>
Result:

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

Watson Bug ID:	3041279

External Customer Info:
External Company:  
External Customer Name: Henry Ho
External Customer Email: 237A22C24921EDF5992015B9
External Test Config: 04/05/2010

Attachments:

Comments: