(x: Decimal, f: number, roundingIncrement: number)
| 25 | |
| 26 | //IMPL: Helper function to find n2 and r2 |
| 27 | function findN2R2(x: Decimal, f: number, roundingIncrement: number) { |
| 28 | const nx = x.times(getPowerOf10(f)).ceil() |
| 29 | const n2 = nx.div(roundingIncrement).ceil().times(roundingIncrement) |
| 30 | const r2 = ToRawFixedFn(n2, f) |
| 31 | return { |
| 32 | n2, |
| 33 | r2, |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * https://tc39.es/ecma402/#sec-torawfixed |
no test coverage detected