UNPKG
theorem.js
Version:
latest (1.2.0)
1.2.0
1.1.0
1.0.1
1.0.0
0.1.0
0.0.2
0.0.1
A Math library for computation in JavaScript
github.com/arguiot/TheoremJS
arguiot/TheoremJS
theorem.js
/
src
/
includes
/
functions
/
math
/
numbers
/
round.js
5 lines
(4 loc)
•
159 B
JavaScript
View Raw
1
2
3
4
5
round
(
n, precision =
0
) {
const
tenPow =
this
.
pow
(
10
, precision)
return
new
BigNumber
(n).
times
(tenPow).
integerValue
(
BigNumber
.
ROUND_HALF_CEIL
).
div
(tenPow) }