Skip to content

Main content

Trailing Zero Preservation Flag Tool

Compare fractional trailing-zero counts of two supplied decimal spellings; does not certify numeric equivalence.

Loading tool…

Description

Parse each signed ordinary decimal token and count only its fractional trailing zeros.

Numeric-looking text has both a value and a written form. Signs, decimal places, exponent markers and trailing zeros can carry display information that ordinary numeric conversion discards; formatting a token does not verify its meaning.

Parse each signed ordinary decimal token and count only its fractional trailing zeros.

When to use this tool

Use Trailing Zero Preservation Flag when you need the specified literal representation or text-level numeric diagnostic.

How to use the tool and how it works

  1. Enter originalToken, formattedToken. 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 originalFractionalTrailingZeros, formattedFractionalTrailingZeros, allRetained. Inspect allRetained before interpreting the associated values.

Parse each signed ordinary decimal token and count only its fractional trailing zeros. allRetained means the formatted count is at least the original count.1

Input fieldMeaning and unitsAccepted input
originalTokenOriginal TokenRequired. Text; maximum UTF-16 length 8192.
formattedTokenFormatted TokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
originalFractionalTrailingZerosOriginal Fractional Trailing ZerosRequired. Safe integer.
formattedFractionalTrailingZerosFormatted Fractional Trailing ZerosRequired. Safe integer.
allRetainedOnly a comparison of fractional trailing-zero counts, not equality of numeric values.Required. Boolean.
json
{
  "input": {
    "originalToken": "1.200",
    "formattedToken": "1.20"
  },
  "output": {
    "originalFractionalTrailingZeros": 2,
    "formattedFractionalTrailingZeros": 1,
    "allRetained": false
  }
}

Limitations and assumptions

  • The two numeric values and their significant digits are not compared. Extra zeros can pass even when the underlying value changes.
  • 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 a locale-aware or destination-specific formatter when broader parsing and presentation rules are needed. Retain original text when lexical precision matters and validate numeric meaning separately.

References

  1. Calculation and input contract: format/trailing-zero-preservation-flag — tool.io

Similar or alternative tools