Commit 3e3921ee authored by ardiansyah's avatar ardiansyah

Merge branch 'dev/ardy' into 'ENV-DEPLOYMENT'

Add Utils fixNumber

See merge request !1627
parents 50fa233f d18faa9b
...@@ -11,3 +11,8 @@ export function roundMath(number, decimalPlaces) { ...@@ -11,3 +11,8 @@ export function roundMath(number, decimalPlaces) {
const factorOfTen = Math.pow(10, decimalPlaces) const factorOfTen = Math.pow(10, decimalPlaces)
return Math.round(number * factorOfTen) / factorOfTen return Math.round(number * factorOfTen) / factorOfTen
} }
export function fixNumber(num, decimalCount = 2) {
const output = Math.round((num + Number.EPSILON) * (Math.pow(10,decimalCount))) / (Math.pow(10,decimalCount))
return output
}
\ 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