proofgeist/fm-json-additions

Proper data-type handling for large powers of 10 in JSON.Merge

Opened this issue · 0 comments

JSON.Merge inserts numeric values which are large powers of 10 into the target as data-type JSONString instead of JSONNumber.

This seems to be due to a FMP nuance whereby JSONGetElement returns certain exp values in a format which differs from GetAsNumber, thus throwing off the "Is-A-Number" test that is based on comparison between GetAsNumber( v ) = GetAsText(v).

Test cases for a simple example have been added to the attached file.

Also included is a variant of the CF with possible fix (JSON.Merge_VAR).

The fix passes all tests assigned to JSON.Merge. That said, there may be a more elegant fix.

Hope this helps & thanks.

JSONAdditions_VAR_20181126_0700.fmp12.zip