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
- Enter originalToken, formattedToken. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| originalToken | Original Token | Required. Text; maximum UTF-16 length 8192. |
| formattedToken | Formatted Token | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| originalFractionalTrailingZeros | Original Fractional Trailing Zeros | Required. Safe integer. |
| formattedFractionalTrailingZeros | Formatted Fractional Trailing Zeros | Required. Safe integer. |
| allRetained | Only a comparison of fractional trailing-zero counts, not equality of numeric values. | Required. Boolean. |
{
"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
Similar or alternative tools
- Decimal Trailing Zero Significance Tag
Count written decimal places and fractional trailing zeros.
- Formatting: Signed Zero Parenthesis Label
Remove a leading plus, retain a negative minus or replace it with parentheses, and flag a negative all-zero value.