From 38ac5449fd6721580907ee487a21b5c2ac118260 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Wed, 3 Feb 2021 11:58:24 -0600 Subject: [PATCH] Add fixed decimals to toFloat util --- scripts/shared/native.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/shared/native.js b/scripts/shared/native.js index fb739a99..ab593dd8 100644 --- a/scripts/shared/native.js +++ b/scripts/shared/native.js @@ -147,8 +147,8 @@ function toInteger(val) { // --------------------------------------------------------------------------- -function toFloat(val) { - return parseFloat(val); +function toFloat(val, fixed = 2) { + return parseFloat((val).toFixed(fixed)); } // ---------------------------------------------------------------------------