Description
Validate a JSON number and return mantissa plus separate optional exponent marker, sign, and digit strings.
A JSON number's grammar, decimal spelling, and parsed binary value are different layers. Exponents, leading zeros, and negative zero can carry lexical information lost during numeric conversion.
Validate a JSON number and return mantissa plus separate optional exponent marker, sign, and digit strings.
When to use this tool
Use JSON: JSON Number Exponent Field Split when you need a numeric token's spelling or serialization convention.
How to use the tool and how it works
- Enter lexeme. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read result. Expand result to inspect the returned fields.
Validate a JSON number and return mantissa plus separate optional exponent marker, sign, and digit strings. Preserve their original spellings.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| lexeme | Supplied token spelling; it is not automatically decoded text. | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Result | Required. Object. |
| result.mantissa | Mantissa | Calculated result member: string. |
| result.hasExponent | Has Exponent | Calculated result member: boolean. |
| result.exponentMarker | Exponent Marker | Calculated result member: string. |
| result.exponentSign | Exponent Sign | Calculated result member: string. |
| result.exponentDigits | Exponent Digits | Calculated result member: string. |
{
"input": {
"lexeme": "-1.20E+003"
},
"output": {
"result": {
"mantissa": "-1.20",
"hasExponent": true,
"exponentMarker": "E",
"exponentSign": "+",
"exponentDigits": "003"
}
}
} Limitations and assumptions
- Absent components return empty strings with hasExponent false; no numeric evaluation or exponent normalization occurs.
- Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use an exact decimal parser when preserving large integers, decimal scale, or lexical round trips is required.
References
Similar or alternative tools
- JSON Number Integer Fraction Token Split
Validate and split a JSON number into signed integer text, fractional digits without the point, and an exponent token including its marker when present.
- JSON Number Scale Token
Validate a JSON number token, count fractional digits, parse its optional signed exponent as a safe integer, and return decimalScale = fractionDigits - exponent.