Description
Detect exact negative-zero spellings, optionally remove only their minus sign, and append percent.
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.
Detect exact negative-zero spellings, optionally remove only their minus sign, and append percent.
When to use this tool
Use Percentage Negative Zero Display Policy when you need the specified literal representation or text-level numeric diagnostic.
How to use the tool and how it works
- Enter token, preserve. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read text, negativeZero. Inspect negativeZero before interpreting the associated values.
Require ordinary signed decimal token text. Detect exact negative-zero spellings, optionally remove only their minus sign, and append percent.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Already a percentage magnitude, such as 5 for 5%; not a raw fraction. | Required. Text; maximum UTF-16 length 8192. |
| preserve | Preserve | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| text | Literal formatted output under the stated grammar and display convention. | Required. Text; maximum UTF-16 length 8192. |
| negativeZero | Negative Zero | Required. Boolean. |
{
"input": {
"token": "-0.00",
"preserve": false
},
"output": {
"text": "0.00%",
"negativeZero": true
}
} Limitations and assumptions
- The token is already a percentage magnitude; no multiplication by 100 or rounding occurs. Other negative values retain their sign.
- 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
- Signed Zero Display Policy
Accept only 0, +0, -0, 0.0, +0.0 and -0.0.
- Percentage Change Plusminus Style
Append percent to the supplied change and add plus only when change is positive and showPlus is true.