Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formatting of PV values #79

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

mducle
Copy link
Contributor

@mducle mducle commented Nov 19, 2024

Add an implementation of PV values formatting as requested in #78

I'm not very experienced with TypeScript so this is probably not the best way of doing this but maybe this could be a start?

Edit: as noted in the issue, the code now agrees with ibex_gui except in specific cases because ibex_gui distinguishes between integer and float types but TypeScript only has a number type.

Fix linting error
Move code to separate function
Scientific output only on small/large _absolute_ value
@mducle mducle marked this pull request as draft November 19, 2024 19:12
Move function from Block to PVutils
Renamed function to match name in ibex_gui
Change to using toPrecision in InstrumentPage
  (when PV values are updated, not in Block)
Despite the bad name, this is to agree with the Java ibex_gui
  code which uses fixed precision (N decimal places, rather
  than N significant figures).
@mducle mducle marked this pull request as ready for review November 20, 2024 20:26
Copy link
Contributor

@Tom-Willemsen Tom-Willemsen left a comment

Choose a reason for hiding this comment

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

Thanks very much for doing this & being willing to add tests - this looks great!

@Tom-Willemsen Tom-Willemsen merged commit e71d75d into ISISComputingGroup:main Nov 20, 2024
3 checks passed
@mducle mducle deleted the pvformattedval branch November 20, 2024 22:24
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