Skip to content

Main content

Decimal Leading Plus Sign Policy

Add or remove an explicit leading plus on strict decimal text while preserving a minus, trailing zeros, and negative zero.

Loading tool…

Description

Apply a leading-plus policy to a restricted decimal string without numerical rounding.

Scientific and financial text formatting separates literal representation from numerical interpretation. A range dash differs from a minus sign, an explicit plus differs from rounding, and asymmetric uncertainty labels need their original units and statistical meaning. Preserving text does not validate the underlying measurement or amount.

Apply a leading-plus policy to a restricted decimal string without numerical rounding.

When to use this tool

Use Decimal Leading Plus Sign Policy when checking the stated literal range, sign, uncertainty or symbol-placement convention.

How to use the tool and how it works

  1. Enter decimalText, addLeadingPlus. 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 formatted. Use the output convention below.

Require optional-sign decimal text with no exponent or redundant integer leading zeros. Preserve all negative text; for nonnegative text remove any existing plus and re-add it only when addLeadingPlus=true.1

Input fieldMeaning and unitsAccepted input
decimalTextOptional sign, integer part without redundant zeros and optional fractional digits; no exponent or locale syntax.Required. Text; maximum UTF-16 length 8192.
addLeadingPlusAdd Leading PlusRequired. Boolean.
Output fieldInterpretationReturned shape
formattedFormattedRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "decimalText": "12.50",
    "addLeadingPlus": true
  },
  "output": {
    "formatted": "+12.50"
  }
}

Limitations and assumptions

  • Negative zero remains negative and decimal digits are not numerically rounded or reinterpreted; this is a restricted string format, not locale-aware number formatting.
  • 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 complete unit/statistical or locale-aware formatting workflow when validating numbers, uncertainty, currency identity and reporting conventions.

References

  1. Calculation and input contract: format/decimal-leading-plus-sign-policy — tool.io

Similar or alternative tools