Cannot call value of non-function type 'String'
Post
Replies
Boosts
Views
Activity
The lines that handle division in the provided code are present in the line that defines the division button in the second line of the ScrollView. Here is the specific line:
CalculatorButton(title: "÷", color: electricOrange, action: { buttonTapped("/") })
The function associated with the ÷ split key is buttonTapped("/"), which calls the buttonTapped function with the "/" parameter when the key is pressed. The logic for splitting is implemented in the buttonTapped function itself.
Unfortunately I had already tried but it doesn't give me the correct result. example, I make 25/2 which should come out as 12.5 but even with this code it comes out as 12.0