Description
Return floor((integerDigits-1)/groupSize) separators and their total column budget.
Alignment requires a declared measure of width. ASCII token characters, supplied display-cell widths and actual rendered glyph widths are different, so a column budget is meaningful only under its stated convention.
Return floor((integerDigits-1)/groupSize) separators and their total column budget.
When to use this tool
Use Decimal Group Separator Budget when you need a supplied field-width or padding calculation.
How to use the tool and how it works
- Enter integerDigits, groupSize, separatorWidth. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read separators, separatorColumns. Use the output convention below.
Require positive integer integerDigits and groupSize and nonnegative integer separatorWidth. Return floor((integerDigits-1)/groupSize) separators and their total column budget.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| integerDigits | Integer Digits | Required. Safe integer; minimum 1. |
| groupSize | Group Size | Required. Safe integer; minimum 1. |
| separatorWidth | Separator Width | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| separators | Separators | Required. Safe integer. |
| separatorColumns | Separator Columns | Required. Safe integer. |
{
"input": {
"integerDigits": 8,
"groupSize": 3,
"separatorWidth": 1
},
"output": {
"separators": 2,
"separatorColumns": 2
}
} Limitations and assumptions
- No number or locale is parsed; widths and fixed grouping are supplied. Indian or irregular grouping requires a different model.
- 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
Measure text in the actual font, terminal or output environment when visual alignment matters. Account for encoding, combining marks, wide characters and locale rather than inferring display width from text length alone.
References
Similar or alternative tools
- Unicode Cell Padding Remainder
Sum content widths and split target-minus-content-minus-padding into nonnegative remaining padding and overflow.
- Mantissa Exponent Field Width
Parse a signed decimal mantissa with optional e/E signed integer exponent.