You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is somewhat mitigated by explicitly allowing the user to specify the Locale and then requesting the appropriate one for format or display (the two available categories).
However, depending upon how the Locale is requested it can return different results. For me, the following Groovy script
To Reproduce
The script above hints there is a problem. To see it in practice requires using QuPath on a computer that uses a different Locale and calling a method that relies upon Locale.getDefault()and uses decimals.... and being surprised.
Basically, it's not that easy to reproduce in practice.
But at the risk of messing up QuPath's preferences
Describe the bug
The use of Java's
Locale
class has caused some trouble in QuPath from the beginning.This is somewhat mitigated by explicitly allowing the user to specify the
Locale
and then requesting the appropriate one for format or display (the two available categories).However, depending upon how the
Locale
is requested it can return different results. For me, the following Groovy scriptprints
It is curious that
Locale.getDefault()
returns something different from the others... and different from what QuPath allows to be specified.@iwbh15 noticed this caused a problem with the QuPath Align extension and traced it back to
Locale
inGeometryTools
, used in conjunction with aNumberFormat
.To Reproduce
The script above hints there is a problem. To see it in practice requires using QuPath on a computer that uses a different
Locale
and calling a method that relies uponLocale.getDefault()
and uses decimals.... and being surprised.Basically, it's not that easy to reproduce in practice.
But at the risk of messing up QuPath's preferences
prints the following
demonstrating the importance of being consistent. If you run this, be sure to restart QuPath afterwards and check the locale is as before.
Expected behavior
QuPath should never use
Locale.getDefault()
internally - a category should always be provided.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: