* Helper function to format a value. Regular numbers will be rounded * to 14 digits to prevent round-off errors from showing up. * @param {*} value
(value)
| 81 | * @param {*} value |
| 82 | */ |
| 83 | function format (value) { |
| 84 | const { math } = getMath() |
| 85 | |
| 86 | return math.format(value, { |
| 87 | fn: function (value) { |
| 88 | if (typeof value === 'number') { |
| 89 | // round numbers |
| 90 | return math.format(value, PRECISION) |
| 91 | } else { |
| 92 | return math.format(value) |
| 93 | } |
| 94 | } |
| 95 | }) |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * auto complete a text |
no test coverage detected
searching dependent graphs…