(num, precision)
| 126 | // The default `precision` value is 6 decimal places. |
| 127 | // `false` can be passed to skip any processing (can be useful to avoid round-off errors). |
| 128 | function formatNum(num, precision) { |
| 129 | if (precision === false) { return num; } |
| 130 | var pow = Math.pow(10, precision === undefined ? 6 : precision); |
| 131 | return Math.round(num * pow) / pow; |
| 132 | } |
| 133 | |
| 134 | // @function trim(str: String): String |
| 135 | // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) |
no test coverage detected