Skip to content

Main content

Currency Negative Accounting Label Tool

Format an exact decimal amount with an explicit currency prefix and parentheses for negative nonzero amounts; no locale conversion or rounding.

Loading tool…

Description

Strip a leading minus and use parentheses only for a nonzero negative lexical amount.

A price ratio depends on its reference amount. Markup relative to cost and margin relative to selling price have different denominators, even when they describe the same monetary difference.

Strip a leading minus and use parentheses only for a nonzero negative lexical amount.

When to use this tool

Use Currency Negative Accounting Label when you need one pricing component with a stated denominator or interpretation label.

How to use the tool and how it works

  1. Enter decimalAmount, currencyToken. 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 label. Use the output convention below.

Require a plain signed decimalAmount without exponent or redundant integer leading zeros and a nonblank CR/LF-free currencyToken. Strip a leading minus and use parentheses only for a nonzero negative lexical amount.1

Input fieldMeaning and unitsAccepted input
decimalAmountDecimal amount spelling under the accepted string grammar; no floating-point amount conversion is used.Required. Text; maximum UTF-16 length 8192.
currencyTokenCurrency TokenRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
labelFormatted label for the supplied components under the convention above.Required. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "decimalAmount": "-1234.50",
    "currencyToken": "$"
  },
  "output": {
    "label": "($1234.50)"
  }
}

Limitations and assumptions

  • This preserves decimal digits without numeric conversion or monetary rounding; the token is arbitrary and negative zero displays without parentheses.
  • 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

Build the full price calculation with consistent currency, taxes, and charging units.

References

  1. Calculation and input contract: format/currency-negative-accounting-label — tool.io

Similar or alternative tools