1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Use locale decimal separator on belt reader display (#816)

* use locale decimal separator on belt reader display

* rename formatter method
This commit is contained in:
LeopoldTal
2020-10-31 10:15:45 +01:00
committed by GitHub
parent 0146aa91bb
commit 070245270f
2 changed files with 12 additions and 3 deletions

View File

@@ -558,7 +558,16 @@ export function formatSeconds(secs) {
}
/**
* Formats a number like 2.5 to "2.5 items / s"
* Formats a number like 2.51 to "2.5"
* @param {number} speed
* @param {string=} separator The decimal separator for numbers like 50.1 (separator='.')
*/
export function round1DigitLocalized(speed, separator = T.global.decimalSeparator) {
return round1Digit(speed).toString().replace(".", separator);
}
/**
* Formats a number like 2.51 to "2.51 items / s"
* @param {number} speed
* @param {boolean=} double
* @param {string=} separator The decimal separator for numbers like 50.1 (separator='.')