A CSPro numeric value, created as a
numeric or as part of an object such as a
List, is generally represented as a JavaScript
number. However,
special values are serialized as follows:
Note that
notappl is
serialized as the string
"NOTAPPL" in JSON but as
null in JavaScript.
When converting a JavaScript value to a CSPro numeric, the following conversions are supported:
The strings representing
special values are processed in a case-insensitive manner. For example, both
"MISSING" and
"miSSing" are converted to
missing.
Converting a
string that contains a number succeeds as long as the number is not followed by a non-number. That is,
"40" is converted to
40 but
"40 days" results in an exception.
Converting an
array containing a single value succeeds, but an exception occurs if the length of the array is not 1. For example,
[ 1979 ] is converted to
1979 but
[ 1979, 1982 ] results in an exception.