Created attachment 557 [details] Minimal example illustrating the problem When using a `G4UIcmdWithADoubleAndUnit` and setting the default unit to `deg` with `SetDefaultUnit`, the `newValue` string seems to be re-formated with **loss** of numeric precision. For example: "45.123456789 deg" becomes "45.1235 deg" When not setting a default unit, the precision is conserved (the newValue string is not modified?) A detailed example can be found over there: https://github.com/niess/bug-g4uicmdwithadoubleandunit. The problem was tested to occur with version 9.6.p04 as well. It was not tested if it occurs with other units as well? My use case is to set latitude / longitude coordinates in degrees, where 4 digits is not accurate enough. I could ommit setting a default unit, but still this behaviour looks error prone to me. Therefore, I would say that this is a bug.
Please issue a UI command "/control/useDoublePrecision" before any of other UI commands. Please note that this command is available from version 10.3.p02. *** This problem has been marked as a duplicate of problem 1921 ***
Thank you. This solves the problem indeed. Still it doesn't look like a safe patch to me since then a user of my package **must** also issue the `/control/useDoublePrecision` command in order to get the proper behaviour. Maybe I could force set-it in my G4UImessenger constructor? But that would be spaming for other UI packages. So I'd rather not use the `SetDefaultUnit` method at moment. Thanks again for the support :) Cheers, Valentin
You may hard-code this command in your main() or any other relevant location before any UI command could be executed.