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
When trying to set a toga.NumberInput() with a decimal step, such as vmag = toga.NumberInput(max=12, min=7, step=0.1)
there is an error at run time:
File "C:\Users\Fabien\Documents\beeware-tutorial\astrofilter\src\astrofilter\app.py", line 24, in startup
self.vmag = toga.NumberInput(max=12, min=7, step=0.1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Fabien\Documents\beeware-tutorial\beeware-venv\Lib\site-packages\toga\widgets\numberinput.py", line 153, in __init__
self.step = step
^^^^^^^^^
File "C:\Users\Fabien\Documents\beeware-tutorial\beeware-venv\Lib\site-packages\toga\widgets\numberinput.py", line 189, in step
self._impl.set_step(self._step)
File "C:\Users\Fabien\Documents\beeware-tutorial\beeware-venv\Lib\site-packages\toga_winforms\widgets\numberinput.py", line 41, in set_step
self.native.Increment = native_decimal(step)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Fabien\Documents\beeware-tutorial\beeware-venv\Lib\site-packages\toga_winforms\widgets\numberinput.py", line 18, in native_decimal
return Convert.ToDecimal.__overloads__[String](str(value))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
System.FormatException: Le format de la chaîne d'entrée est incorrect. à System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) à System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt) à System.Convert.ToDecimal(String value)
Steps to reproduce
write any minimal app with a decimal step, not integer
run it under windows (not tested on other platform
see the error
Expected behavior
It should work with decimam number, such as described in the online documentation.
It does not work even if the step is a string
Screenshots
No response
Environment
Operating System: Windows 10
Python version: 3.11
Software versions:
Briefcase: 0.3.19
Toga: 0.4.5
...
Logs
Additional context
No response
The text was updated successfully, but these errors were encountered:
mhsmith
changed the title
toga.NumberInput() dose not accept decimal number on python 3.11
toga.NumberInput() on Windows does not accept decimal point in languages that use decimal comma
Aug 19, 2024
Thanks for the report. This is probably because your system language is set to French, so Windows is expecting a decimal comma, but Toga is passing a decimal point.
I wouldn't be surprised if other platforms have a similar problem. For example, here is a related issue I hit on Android in a different project.
Describe the bug
When trying to set a toga.NumberInput() with a decimal step, such as vmag = toga.NumberInput(max=12, min=7, step=0.1)
there is an error at run time:
Steps to reproduce
Expected behavior
It should work with decimam number, such as described in the online documentation.
It does not work even if the step is a string
Screenshots
No response
Environment
Logs
Additional context
No response
The text was updated successfully, but these errors were encountered: