Commit eafe2579 authored by syadziy's avatar syadziy

push rounding math

parent 1a05bda9
......@@ -5,4 +5,9 @@ export function titleCase(text) {
// .replace(/\s(.)/g, function($1) { return $1.toUpperCase(); })
return value
}
export function roundMath(number, decimalPlaces) {
const factorOfTen = Math.pow(10, decimalPlaces)
return Math.round(number * factorOfTen) / factorOfTen
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment