@technobuddha > library > Math > Verbalization
Type Alias: FractionOptions
ts
type FractionOptions = {
and?: Numbering["and"];
denominators?: Numbering["denominators"];
hyphen?: Numbering["hyphen"];
ordinal?: Numbering["ordinal"];
output?: | "numeric"
| "alphabetic"
| "hybrid"
| Numbering["output"];
precision?: Numbering["precision"];
shift?: Numbering["shift"];
tolerance?: Numbering["tolerance"];
};Defined in: fraction.ts:9
Options for customizing the output and behavior of fraction number representations.
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
and? | Numbering["and"] | (empty string) | Text to use for "and" in compound numbers (e.g., "one hundred and one"). | src/fraction.ts:20 |
denominators? | Numbering["denominators"] | 'common' | Type of denominators to use when expressing fractions. | src/fraction.ts:38 |
hyphen? | Numbering["hyphen"] | ' ' (space) | Text to use for hyphens in compound numbers (e.g., "twenty-one"). | src/fraction.ts:26 |
ordinal? | Numbering["ordinal"] | false | Whether to output ordinal numbers (e.g., "first", "second") instead of cardinal numbers. | src/fraction.ts:50 |
output? | | "numeric" | "alphabetic" | "hybrid" | Numbering["output"] | 'alphabetic' | Output format for the number representation. | src/fraction.ts:14 |
precision? | Numbering["precision"] | 9 | Precision for decimal/fraction conversion. | src/fraction.ts:44 |
shift? | Numbering["shift"] | undefined | Whether to shift the fractional part of the number. | src/fraction.ts:56 |
tolerance? | Numbering["tolerance"] | 0.01 | Tolerance for floating-point comparison when converting decimals to fractions. | src/fraction.ts:32 |