1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

round instead of floor

This commit is contained in:
EmeraldBlock 2022-05-20 18:19:23 -05:00
parent 8f5525eb88
commit d98e81df50

View File

@ -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;
}
/**