* Return the reference rounded to `p` significant digits, as a decimal string * comparable to BigDecimal.toString() (drop trailing zeros of the reference by * relying on the same significand rounding BigDecimal uses).
(arg: string, p: number)
| 44 | * relying on the same significand rounding BigDecimal uses). |
| 45 | */ |
| 46 | function refRounded(arg: string, p: number): BigDecimal { |
| 47 | const saved = BigDecimal.precision; |
| 48 | BigDecimal.precision = p; |
| 49 | try { |
| 50 | return new BigDecimal(REFS[arg]).toPrecision(p); |
| 51 | } finally { |
| 52 | BigDecimal.precision = saved; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | const PRECISIONS = [15, 21, 50, 100, 200, 500]; |
| 57 |
no test coverage detected