UNPKG
@alexaegis/advent-of-code-lib
Version:
latest (1.0.1)
1.0.1
1.0.0
Advent of Code Library
github.com/AlexAegis
AlexAegis/advent-of-code
@alexaegis/advent-of-code-lib
/
round-to-decimal.function-O5Uesn7H.cjs
8 lines
(7 loc)
•
214 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
"use strict"
;
const
roundToDecimal
= (
n, decimal
) => {
return
Number
.
parseFloat
(
Math
.
round
(
Number
.
parseFloat
(
`
${n.toString()}
e+
${decimal}
`
)) +
`e-
${decimal}
`
); };
exports
.
roundToDecimal
= roundToDecimal;