Skip to content

Main content

Signed Zero Display Policy Tool

Preserve explicit source sign evidence while selecting a narrow zero display policy; no numeric rounding is performed.

Loading tool…

Description

Accept only 0, +0, -0, 0.0, +0.0 and -0.0.

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.

Accept only 0, +0, -0, 0.0, +0.0 and -0.0.

When to use this tool

Use Signed Zero Display Policy when you need the specified literal representation or text-level numeric diagnostic.

How to use the tool and how it works

  1. Enter source, accounting. 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 display, negativeSource. Inspect negativeSource before interpreting the associated values.

Accept only 0, +0, -0, 0.0, +0.0 and -0.0. Return (0) for a negative source under accounting, otherwise 0, and retain negativeSource.1

Input fieldMeaning and unitsAccepted input
sourceCaller-supplied source label; authenticity is not verified.Required. Text; one of "0", "+0", "-0", "0.0", "+0.0", "-0.0"; maximum UTF-16 length 8192.
accountingAccountingRequired. Boolean.
Output fieldInterpretationReturned shape
displayDisplayRequired. Text; maximum UTF-16 length 8192.
negativeSourceNegative SourceRequired. Boolean.
json
{
  "input": {
    "source": "-0",
    "accounting": true
  },
  "output": {
    "display": "(0)",
    "negativeSource": true
  }
}

Limitations and assumptions

  • This deliberately narrows allowed zero spellings and discards fractional precision. It is display policy, not numeric signed-zero preservation in a data format.
  • 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/signed-zero-display-policy — tool.io

Similar or alternative tools