Skip to content

fix(FPSMonitor): fix FPSMonitor for float numbers - #3584

Open
Jo-Byr wants to merge 1 commit into
Kitware:masterfrom
Jo-Byr:fix-fps-monitor
Open

fix(FPSMonitor): fix FPSMonitor for float numbers#3584
Jo-Byr wants to merge 1 commit into
Kitware:masterfrom
Jo-Byr:fix-fps-monitor

Conversation

@Jo-Byr

@Jo-Byr Jo-Byr commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Context

FPSMonitor has 2 issues with float numbers:

  1. They make the display incorrect for float numbers > 1000. For example, for input 123456789.01 we expect output "123'456'789.01" or "123'456'789" if we consider decimals negligible, but we actually got "123'456'644'" due to slice(-3) taking the digits into consideration (123456789.01 % 1000 === 789.0100000053644)

  2. There is no size limit so we sometimes had outputs such as "0.010775999999999999"

Results

digits are limited to 6 with toFixed

Digits are truncated for numbers > 1000

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Limit float number digits to 6
Fix wrong output of formatNumbers for float numbers
@Jo-Byr Jo-Byr self-assigned this Jul 27, 2026

@sankhesh sankhesh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants