Skip to content

Conversation

@ES-Alexander
Copy link
Contributor

  • Increases the automatic precision scaling range from (0-kilo (103)) to (pico (10-12) to Tera (1012))
  • Dynamically determines whether the value is overflowing, which
Screen.Recording.2025-11-24.at.11.42.55.am.mov

Maybe not the best use of my time, but it was a fun problem to work on, I'm pretty happy with the result, and I learnt some more about Vue and TypeScript in the process, so I'm calling it a win 😅

@rafaellehmkuhl
Copy link
Member

Maybe not the best use of my time, but it was a fun problem to work on

We all know this feeling haha

Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

@ES-Alexander I actually found a problem with the new approach around m/s:

on master:
image
image

on the PR:
image
image

@ES-Alexander
Copy link
Contributor Author

ES-Alexander commented Nov 24, 2025

Ahh, that's actually intentional - it's set to have a minimum of 4 display characters because the minus gets rid of one, and I think there are issues with scaling and the like when there are fewer than 3 precision characters.

I think it's reasonable for users with long unit symbols to make the widget a bit longer :-)

@rafaellehmkuhl
Copy link
Member

Ahh, that's actually intentional - it's set to have a minimum of 4 display characters because the minus gets rid of one, and I think there are issues with scaling and the like when there are fewer than 3 precision characters.

I think it's reasonable for users with long unit symbols to make the widget a bit longer :-)

I see you tried to account for that more or less with some predefined list of longer units. Maybe we can check the actual width that this unit takes in the UI and adjust to that? I believe we can do that through the scrollWidth property.

@ES-Alexander
Copy link
Contributor Author

Maybe we can check the actual width that this unit takes in the UI and adjust to that?

That would be great (for determining overflow), I just wasn't sure whether it was difficult to do.

We could also add a special case that allows display characters to be 3 for values between 0.01 and 99, since some people might want that too.

I'll try to keep both in mind when I come back to finish this off :-)

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.

VGI: negative values are using incorrect precision

2 participants