Improve number format in SwingNumberWidget#54
Conversation
50e0b65 to
3b51400
Compare
|
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: https://forum.image.sc/t/save-one-tiff-projection-from-a-current-view-in-bdv/33965/28 |
|
@imagejan Quick question now that I managed to build it: currently is there a way to force / support scientific notation like |
|
But this works! Ok, great! |
|
Glad you found a working option! See also: https://stackoverflow.com/a/2944856/1919049 and https://javadoc.scijava.org/Java8/index.html?java/text/DecimalFormat.html As well as this related issue: #2 |
|
Ok, just one thing, I tried a few things which can probably be improved. For a Double field:
Do you think we can at least get the display updated to the previous value when we type non valid characters ? Maybe it's a different issue than this PR ? |
3b51400 to
ecf5184
Compare
|
I updated the pull request to depend on There's one minor issue with the tests: on non-US locales, the test fails with: @hinerm, @ctrueden: what's your opinion, should we always force a US locale in the Swing dialogs? That's how all the ImageJ 1.x dialogs do it, if I'm not mistaken. So it would help streamline the user experience... |
Please do it !! Me and @tinevez (and many users) had terrible experiences with locale ... USA, USA! ;-) |
ecf5184 to
95df845
Compare
|
@ctrueden, @hinerm This pull request is now ready for review. I removed the SNAPSHOT coupling and pinned to the newly released @NicoKiaru I tried forcing US locale in |
Ok, let's try to live with that, I couldn't find a way either. And anyway maybe it's better to set the "Locale" more globally than in some widgets here and there. This PR is already a great improvement! |
95df845 to
d89b7c9
Compare
Mention scijava-ui-swing improvement on number formatting done by @imagejan in scijava/scijava-ui-swing#54

This pull request depends on scijava/scijava-common#405 and supersedes #52.
It includes the changes by @BoudewijnvanLangerak (in #52) as a squashed commit.
Changes can be tested with
SwingNumberWidgetDemoadded here, or with the following script:Here's a visual comparison before and after the changes in this commit:
(Fixes #45.)