mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-02-18 22:09:20 +00:00
rename formatter method
This commit is contained in:
parent
9821ba656f
commit
61e46c3553
@ -562,7 +562,7 @@ export function formatSeconds(secs) {
|
||||
* @param {number} speed
|
||||
* @param {string=} separator The decimal separator for numbers like 50.1 (separator='.')
|
||||
*/
|
||||
export function formatApproximateSpeed(speed, separator = T.global.decimalSeparator) {
|
||||
export function round1DigitLocalized(speed, separator = T.global.decimalSeparator) {
|
||||
return round1Digit(speed).toString().replace(".", separator);
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { globalConfig } from "../../core/config";
|
||||
import { Loader } from "../../core/loader";
|
||||
import { formatApproximateSpeed, smoothPulse } from "../../core/utils";
|
||||
import { round1DigitLocalized, smoothPulse } from "../../core/utils";
|
||||
import { enumItemProcessorRequirements, enumItemProcessorTypes } from "../components/item_processor";
|
||||
import { Entity } from "../entity";
|
||||
import { GameSystem } from "../game_system";
|
||||
@ -92,7 +92,7 @@ export class ItemProcessorOverlaysSystem extends GameSystem {
|
||||
parameters.context.textAlign = "center";
|
||||
parameters.context.font = "bold 10px GameFont";
|
||||
parameters.context.fillText(
|
||||
formatApproximateSpeed(readerComp.lastThroughput),
|
||||
round1DigitLocalized(readerComp.lastThroughput),
|
||||
(staticComp.origin.x + 0.5) * globalConfig.tileSize,
|
||||
(staticComp.origin.y + 0.62) * globalConfig.tileSize
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user