Skip to content

Main content

JSON: JSON Number Exponent Field Split Tool

Split strict JSON number spelling into lexical mantissa/exponent fields while preserving case, sign and leading exponent zeros.

Loading tool…

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

  1. Enter lexeme. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
lexemeSupplied token spelling; it is not automatically decoded text.Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.mantissaMantissaCalculated result member: string.
result.hasExponentHas ExponentCalculated result member: boolean.
result.exponentMarkerExponent MarkerCalculated result member: string.
result.exponentSignExponent SignCalculated result member: string.
result.exponentDigitsExponent DigitsCalculated result member: string.
json
{
  "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

  1. Calculation and input contract: json/json-number-exponent-field-split — tool.io

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.