Description
Left-pad each numeric component to its minimum width and join with separator.
Numeric-looking text has both a value and a written form. Signs, decimal places, exponent markers and trailing zeros can carry display information that ordinary numeric conversion discards; formatting a token does not verify its meaning.
Left-pad each numeric component to its minimum width and join with separator.
When to use this tool
Use Mixed Unit Component Leading Zero Style when you need the specified literal representation or text-level numeric diagnostic.
How to use the tool and how it works
- Enter components, widths, separator. Keep parallel arrays aligned. 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 aligned nonnegative integer components and widths 1-100. Left-pad each numeric component to its minimum width and join with separator.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| components | Components | Required. Array of safe integer; maximum items 256. |
| widths | Widths | Required. Array of safe integer; maximum items 256. |
| separator | Separator | 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": {
"components": [
2,
3,
4
],
"widths": [
1,
2,
2
],
"separator": ":"
},
"output": {
"text": "2:03:04"
}
} Limitations and assumptions
- Widths are minimums, so oversized components are not truncated. No mixed-unit carry, range normalization, or semantic validity is checked.
- 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
Use a locale-aware or destination-specific formatter when broader parsing and presentation rules are needed. Retain original text when lexical precision matters and validate numeric meaning separately.
References
Similar or alternative tools
- Clock Duration Over 24 Hour Label
Divide into unbounded total hours and modulo-60 minutes/seconds; pad the latter to two digits and hours optionally to at least two.
- Formatting: Exponent Sign Zero Padding
Pad magnitude and prefix minus or the optional positive plus sign.