Description
Remove a leading plus, retain a negative minus or replace it with parentheses, and flag a negative all-zero value.
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.
Remove a leading plus, retain a negative minus or replace it with parentheses, and flag a negative all-zero value.
When to use this tool
Use Formatting: Signed Zero Parenthesis Label when you need the specified literal representation or text-level numeric diagnostic.
How to use the tool and how it works
- Enter literal, negativeStyle. 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.
Require an ordinary signed decimal literal with 1-24 digits in each present part. Remove a leading plus, retain a negative minus or replace it with parentheses, and flag a negative all-zero value.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| literal | Literal | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| negativeStyle | Negative Style | Required. Text; one of "minus", "parentheses". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Object containing the calculated members; expand to inspect the fields below. | Required. Object. |
| result.label | Literal label; no independent factual or authorization verdict. | Calculated result member: string. |
| result.negativeZero | Whether the source literal has a minus sign and an all-zero numerical magnitude. | Calculated result member: boolean. |
{
"input": {
"literal": "-0.00",
"negativeStyle": "parentheses"
},
"output": {
"result": {
"label": "(0.00)",
"negativeZero": true
}
}
} Limitations and assumptions
- Original fractional digits are preserved. The flag describes the literal's sign, not a different numeric quantity; no rounding or locale grouping is applied.
- 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 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.
- Number Parenthesis Negative Zero Policy
Use parentheses for negative numeric value, or for zero only when both negativeZero and accountZero are true; otherwise use its numeric string.