Skip to content

Commit

Permalink
Merge pull request #344 from paulplant/develop
Browse files Browse the repository at this point in the history
prevent insulin unit fractions from being deleted in some locales
  • Loading branch information
JohanDegraeve authored Apr 30, 2022
2 parents 7c5f20a + bba7d7a commit e7f0b9e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ class TreatmentsInsertViewController : UIViewController {
// if no deletes treatMentEntryToUpdate
let updateFunction = { (textField: UITextField) in

if let text = textField.text, let value = Double(text), value > 0 {
// the values are stored in coredate with a "." decimal point. We need to just ensure the decimal separator is a point and not a comma (which some locales use)
if let text = textField.text, let value = Double(text.replacingOccurrences(of: ",", with: ".")), value > 0 {

// keep track if changed or not
var treatMentEntryToUpdateChanged = false
Expand Down

0 comments on commit e7f0b9e

Please sign in to comment.