Description
Pad its magnitude, insert a decimal point by digits, prefix symbol, and parenthesize negative amounts.
Monetary presentation depends on the currency's minor-unit scale, sign convention and locale. Supplying those display choices explicitly avoids confusing formatting with currency conversion, fee calculation or payment processing.
Pad its magnitude, insert a decimal point by digits, prefix symbol, and parenthesize negative amounts.
When to use this tool
Use Money Minor Unit Parenthesis Style when you need the specified monetary sign or minor-unit layout.
How to use the tool and how it works
- Enter minorUnits, digits, symbol. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read text. Use the output convention below.
Require digits 0-6 and integer minorUnits. Pad its magnitude, insert a decimal point by digits, prefix symbol, and parenthesize negative amounts.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| minorUnits | Safe integer in the caller-supplied minor-unit scale. | Required. Safe integer. |
| digits | Number of decimal places in that monetary scale, not inferred from symbol. | Required. Safe integer; minimum 0; maximum 6. |
| symbol | Symbol | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| text | Literal formatted output under the stated grammar and display convention. | Required. Text; maximum UTF-16 length 8192. |
{
"input": {
"minorUnits": -12345,
"digits": 2,
"symbol": "$"
},
"output": {
"text": "($123.45)"
}
} Limitations and assumptions
- Digits and symbol are supplied rather than derived from a currency registry. No exchange rate, locale grouping, rounding, or real payment is performed.
- 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.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Use the intended currency metadata and locale formatter for production monetary display. Keep arithmetic, rounding, exchange rates and actual transaction authorization separate from text presentation.
References
Similar or alternative tools
- Currency Negative Sign Spacing Token
Accept minus-before, minus-after or parentheses style and empty, ordinary-space or no-break-space gap.
- Formatting: Signed Zero Parenthesis Label
Remove a leading plus, retain a negative minus or replace it with parentheses, and flag a negative all-zero value.