Title: No parameter attribute for number formats · Issue #45 · scijava/scijava-ui-swing · GitHub
Open Graph Title: No parameter attribute for number formats · Issue #45 · scijava/scijava-ui-swing
X Title: No parameter attribute for number formats · Issue #45 · scijava/scijava-ui-swing
Description: This issue was recently brought up on the forum... currently, if for example, you want to display the a default value of 0.0178 in the dialog for a user… #@Double(label="Distance", value=0.01780, persist=false) distance When the code run...
Open Graph Description: This issue was recently brought up on the forum... currently, if for example, you want to display the a default value of 0.0178 in the dialog for a user… #@Double(label="Distance", value=0.01780, p...
X Description: This issue was recently brought up on the forum... currently, if for example, you want to display the a default value of 0.0178 in the dialog for a user… #@Double(label="Distance", value=...
Opengraph URL: https://github.com/scijava/scijava-ui-swing/issues/45
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"No parameter attribute for number formats","articleBody":"This issue was recently [brought up on the forum](https://forum.image.sc/t/script-parameters-increasing-decimal-places-for-double/22919)... currently, if for example, you want to display the a default value of ```0.0178``` in the dialog for a user…\r\n\r\n```#@Double(label=\"Distance\", value=0.01780, persist=false) distance```\r\n\r\nWhen the code runs… you get a pre-set value of ```0.018``` popping up and there is no current method to set the number of decimal places for that input.\r\n\r\nAs stated by @imagejan on the forum:\r\n\r\n\u003e \"The spinner created in ```SwingNumberWidget``` is using the default ```DecimalFormat``` which apparently has a maximum of three decimal places.\r\n\u003e \r\n\u003e You can somehow work around the issue by using a slider or scroll bar (within a defined range). But while the actual values can contain more decimal places (as shown by the ```println``` statement, there’s still no visual feedback inside the spinner text field:\r\n\u003e \r\n\u003e ```#@ Double (label=\"Distance\", min=0, max=0.05, value=0.01780, persist=false, stepSize=0.0001, style=slider) distance```\r\n```println distance```\r\n\u003e \r\n\u003e There’s no parameter attribute for number formats, but we could maybe use the `style` attribute for this; in any case we should try to guess a suitable spinner number format from the combination of min, max and stepSize, or from the default value…\"","author":{"url":"https://github.com/etadobson","@type":"Person","name":"etadobson"},"datePublished":"2019-02-14T14:53:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/45/scijava-ui-swing/issues/45"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bbc2343b-3292-a02a-b56a-85cc53f0b22a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E572:3A860B:B841BB:1055768:6978C742 |
| html-safe-nonce | e791b104025862edb59f0b42d7c5da27baf2d8664da481fb9981fbd83f2702df |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTcyOjNBODYwQjpCODQxQkI6MTA1NTc2ODo2OTc4Qzc0MiIsInZpc2l0b3JfaWQiOiIzNjQxNDgzMDI0MzQxMTkwNDY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0a62f5af1051a16b27a58f71886fb3e6b8ee10981007fec5b6331612f0f4fa02 |
| hovercard-subject-tag | issue:410337568 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scijava/scijava-ui-swing/45/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cfeac16e6897ac03545bdccccb844a5dc034afb2000b7a37d8cb16af8c916af6/scijava/scijava-ui-swing/issues/45 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cfeac16e6897ac03545bdccccb844a5dc034afb2000b7a37d8cb16af8c916af6/scijava/scijava-ui-swing/issues/45 |
| og:image:alt | This issue was recently brought up on the forum... currently, if for example, you want to display the a default value of 0.0178 in the dialog for a user… #@Double(label="Distance", value=0.01780, p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | etadobson |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8a71ca1f7ab5436216e1df86f398ef7a51ed3152c90e3f7332fc70cf97fcb9d6 |
| turbo-cache-control | no-preview |
| go-import | github.com/scijava/scijava-ui-swing git https://github.com/scijava/scijava-ui-swing.git |
| octolytics-dimension-user_id | 1262770 |
| octolytics-dimension-user_login | scijava |
| octolytics-dimension-repository_id | 19014728 |
| octolytics-dimension-repository_nwo | scijava/scijava-ui-swing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 19014728 |
| octolytics-dimension-repository_network_root_nwo | scijava/scijava-ui-swing |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | eaed570eead52a9920afef75dc3eb6d826fdc5ef |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width