Dollar Figure Style
Validate dollar-figure grouping and decimal precision.
Description
Dollar-figure style constructs a fixed-decimal, grouped numeric rendering with a dollar prefix.
Dollar-figure style constructs a fixed-decimal, grouped numeric rendering with a dollar prefix. The check compares that rendering exactly.1
Validate dollar-figure grouping and decimal precision.
When to use Dollar Figure Style
Use this tool to validate dollar-figure grouping and decimal precision.
Prepare the text, recorded observations, aligned figures or editorial criteria requested. Confirm what each label, count, timestamp or supplied flag represents before interpreting the result.
How to use Dollar Figure Style and understand its results
- Prepare the text, recorded observations, aligned figures or editorial criteria requested. Confirm what each label, count, timestamp or supplied flag represents before interpreting the result.
- Enter amount, decimalPlaces, renderedAmount using the field table and calculation rules, then run the tool.
- Read expectedAmount, matchesExpected. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| amount | Dollar amount | number | Required |
| decimalPlaces | Decimal places | integer; minimum: 0; maximum: 6 | Required |
| renderedAmount | Rendered amount | string | Required |
Enter finite amount, integer decimal places 0–6, and rendering. Format using en-US minimum/maximum fraction digits, prepend $, trim the rendering and compare exactly. A negative amount is rendered with $ before the minus sign.
expected="$"+en-US formatted amount Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| expectedAmount | Expected dollar figure | string |
| matchesExpected | Matches expected amount | boolean |
{
"input": {
"amount": 1234.5,
"decimalPlaces": 2,
"renderedAmount": "$1,234.50"
},
"output": {
"expectedAmount": "$1,234.50",
"matchesExpected": true
}
} Limitations and assumptions
No exchange rate, dollar currency identity or publication-specific style is determined.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors. A successfully returned false flag is an evaluated outcome; its meaning is explained above.
Alternative or Complementary methods
Use Percent Range Style: Validate percentage-range punctuation and repeated percent signs. For a complementary task, use Temperature Style: Validate a rendered temperature against supplied unit and degree-symbol policy.
References
-
Dollar Figure Style — tool.io
Similar or alternative tools
- Percent Range Style
Validate percentage-range punctuation and repeated percent signs.
- Temperature Style
Validate a rendered temperature against supplied unit and degree-symbol policy.