@technobuddha > library > Math > Verbalization
Type Alias: Numbering
ts
type Numbering = {
and: string;
denominators: "common" | "wrench" | number[];
hyphen: string;
ordinal: boolean;
output: {
fraction: "numeric" | "alphabetic";
integer: "numeric" | "alphabetic" | "hybrid";
};
precision: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
shift: false | "decimal" | "fraction";
tolerance: number;
};Defined in: numbering.ts:14
Options for controlling how numbers are converted to words or symbols.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
and | string | Word to place after the hundreds. E.g., "one hundred and one" vs. "one hundred one" | src/numbering.ts:29 |
denominators | "common" | "wrench" | number[] | Allowed denominators for fractions. - 'common': typical denominators (2, 3, 4, etc.) - 'wrench': denominators used in wrench sizes - number[]: custom denominators | src/numbering.ts:43 |
hyphen | string | Character to place between the tens and ones units. E.g., "twenty-one" vs. "twenty one" | src/numbering.ts:32 |
ordinal | boolean | Whether to use ordinal form (e.g., "first", "second", "third"). | src/numbering.ts:49 |
output | { fraction: "numeric" | "alphabetic"; integer: "numeric" | "alphabetic" | "hybrid"; } | Output format for integer and fraction parts. - integer: 'numeric' | 'alphabetic' |
output.fraction | "numeric" | "alphabetic" | fraction output format: 'numeric' or 'alphabetic' | src/numbering.ts:25 |
output.integer | "numeric" | "alphabetic" | "hybrid" | integer output format: 'numeric', 'alphabetic', or 'hybrid' | src/numbering.ts:22 |
precision | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Number of decimal places or significant digits to use (1-9). | src/numbering.ts:46 |
shift | false | "decimal" | "fraction" | Whether to shift the output. - false: no shift - 'decimal': shift decimal part - 'fraction': shift fraction part | src/numbering.ts:57 |
tolerance | number | Maximum allowed difference between the actual and represented value. | src/numbering.ts:35 |