Hi, just completed Day 37 and followed the tutorials for the iExpense app, but in the end i had a problem while trying to give an input for the "amount" Double with the currency format set to "EUR".
When i tried to type a value and hit return or the button "Save", the value would automatically reset to the default one (in this case "€0.00" instead of returning the one i wrote.
My code was this:
TextField("Amount", value: $amount, format: .currency(code: "EUR"))
.keyboardType(.decimalPad)
While searching for a solution online i ended up fixing the problem with this code:
TextField("Amount", value: $amount, format: .currency(code: Locale.current.currency?.identifier ?? "EUR"))
.keyboardType(.decimalPad)
But i wanted to understand why the first one didn't work, what makes the difference in the second one that fixed the problem?