Skip to content

Conversation

@mducle
Copy link
Collaborator

@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
Member

@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