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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition between default and scientific number formatting is not smooth #3330

Open
jokasimr opened this issue Nov 15, 2023 · 0 comments
Open

Comments

@jokasimr
Copy link
Contributor

sc.array(dims=['spectrum'], values=[0.011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  0.011
sc.array(dims=['spectrum'], values=[0.0011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  0.001
sc.array(dims=['spectrum'], values=[0.00011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  0.000     <-----  Looks like it is zero!
sc.array(dims=['spectrum'], values=[0.000011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  1.100e-05

Perhaps a good rule of thumb would be to always show at least 2 significant digits.
Then the above would instead look like:

sc.array(dims=['spectrum'], values=[0.011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  0.011
sc.array(dims=['spectrum'], values=[0.0011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  1.100e-03
sc.array(dims=['spectrum'], values=[0.00011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  1.100e-04
sc.array(dims=['spectrum'], values=[0.000011])
# Out: scipp.Variable (264 Bytes (spectrum: 1)  float64  饾煓  1.100e-05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants