From d98e81df5047a66e80dc40607adee9fc03f16dcd Mon Sep 17 00:00:00 2001 From: EmeraldBlock Date: Fri, 20 May 2022 18:19:23 -0500 Subject: [PATCH] round instead of floor --- src/js/core/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/core/utils.js b/src/js/core/utils.js index 319fe0ea..a1f3d254 100644 --- a/src/js/core/utils.js +++ b/src/js/core/utils.js @@ -334,7 +334,7 @@ export function waitNextFrame() { * @returns {number} */ export function round1Digit(n) { - return Math.floor(n * 10.0) / 10.0; + return Math.round(n * 10.0) / 10.0; } /** @@ -343,7 +343,7 @@ export function round1Digit(n) { * @returns {number} */ export function round2Digits(n) { - return Math.floor(n * 100.0) / 100.0; + return Math.round(n * 100.0) / 100.0; } /** @@ -352,7 +352,7 @@ export function round2Digits(n) { * @returns {number} */ export function round3Digits(n) { - return Math.floor(n * 1000.0) / 1000.0; + return Math.round(n * 1000.0) / 1000.0; } /** @@ -361,7 +361,7 @@ export function round3Digits(n) { * @returns {number} */ export function round4Digits(n) { - return Math.floor(n * 10000.0) / 10000.0; + return Math.round(n * 10000.0) / 10000.0; } /**