new CompiledFormat(steps, opts, sortedPos)
A wrapper object for compiled formats.
Parameters:
| Name | Type | Description |
|---|---|---|
steps |
Array.<Step> | An array of step functions to be called during CompiledFormat#run |
opts |
object | A options object that will be passed to every step function as part of the run state |
sortedPos |
Array.<number> | An array of output position indexes of each step in steps |
Methods
-
run(num, roundFn, lang) → {string}
-
Runs all the transformation step functions using the given number and rounding function.
Parameters:
Name Type Description numThe number to format roundFnfunction A rounding function langstring The language code Returns:
The formatted number- Type
- string