UNPKG

theorem.js

Version:

A Math library for computation in JavaScript

5 lines (4 loc) 159 B
round(n, precision = 0) { const tenPow = this.pow(10, precision) return new BigNumber(n).times(tenPow).integerValue(BigNumber.ROUND_HALF_CEIL).div(tenPow) }