From 5e3245474b80ddb78f628dff49d596343c0ee112 Mon Sep 17 00:00:00 2001 From: Jo-Byr Date: Mon, 27 Jul 2026 14:11:50 +0200 Subject: [PATCH] fix(FPSMonitor): fix FPSMonitor for float numbers Limit float number digits to 6 Fix wrong output of formatNumbers for float numbers --- Sources/Interaction/UI/FPSMonitor/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Interaction/UI/FPSMonitor/index.js b/Sources/Interaction/UI/FPSMonitor/index.js index a2ed9c04ccd..c696218a508 100644 --- a/Sources/Interaction/UI/FPSMonitor/index.js +++ b/Sources/Interaction/UI/FPSMonitor/index.js @@ -7,9 +7,13 @@ function formatNumbers(n) { const sections = []; let size = n; while (size > 1000) { - sections.push(`000${size % 1000}`.slice(-3)); + sections.push(`000${Math.floor(size) % 1000}`.slice(-3)); size = Math.floor(size / 1000); } + if (size % 1 !== 0) { + // float + size = size.toFixed(6); + } if (size > 0) { sections.push(size); }