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
- Enter decimalAmount, currencyToken. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| decimalAmount | Decimal amount spelling under the accepted string grammar; no floating-point amount conversion is used. | Required. Text; maximum UTF-16 length 8192. |
| currencyToken | Currency Token | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| label | Formatted label for the supplied components under the convention above. | Required. Text; maximum UTF-16 length 8192. |
{
"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
Similar or alternative tools
- American Manuscript Dollar Cent Notation
Parse nonnegative dollarsDecimal exactly, require cents 0-99, and form a two-decimal-place string.
- format/currency
Format a finite amount using an explicit currency code and locale.