MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / round

Method round

__test__/theorem.js:1297–1300  ·  view source on GitHub ↗
(n, precision = 0)

Source from the content-addressed store, hash-verified

1295 return new BigNumber(out - 1)
1296 }
1297 round(n, precision = 0) {
1298 const tenPow = this.pow(10, precision)
1299 return new BigNumber(n).times(tenPow).integerValue(BigNumber.ROUND_HALF_CEIL).div(tenPow)
1300 }
1301 rand(n = 1, crypto = false) {
1302 const BN = BigNumber.clone({ CRYPTO: crypto })
1303 let out = []

Callers 3

correlation.jsFile · 0.80
correlationMethod · 0.80
test.jsFile · 0.80

Calls 3

powMethod · 0.95
divMethod · 0.80
timesMethod · 0.80

Tested by

no test coverage detected