nightscout / Trio

Trio - an automated insulin delivery system for iOS based on the OpenAPS algorithm with adaptations.
https://docs.diy-trio.org/en/latest/
MIT License
98 stars 531 forks source link

Prevent crash when holding backspace #352

Closed MikePlante1 closed 4 months ago

MikePlante1 commented 4 months ago

Currently, entering text into Note while entering a meal and then holding the backspace button would crash the app. This PR prevents that crash.

MikePlante1 commented 4 months ago

Updated to use decimalFormatter.groupingSeparator instead of just "," to allow it to work for all regions.

MikePlante1 commented 4 months ago
  • Can someone check localization?

    • I tried different languages and did not see the decimal/thousands place delimiters I expected
    • If confirmed, that should be a separate issue.

You have to change the Region of the phone, not the Language. Each of the following produces a different grouping separator: US 9,999,999,999.5 UK 9.999.999.999,5 Norway: 9 999 999 999,5 India: 9,99,99,99,999.5

MikePlante1 commented 4 months ago

I removed the grouping separator fix from this PR, as a similar solution has been added to https://github.com/nightscout/Trio/pull/362