A text box contains text even when someone types digits into it. Convert that text when a calculation needs a number. The conversion can fail, so decide what the app should show for malformed input instead of allowing the failure to masquerade as a valid amount. An empty entry also needs an explicit meaning.
Trim outer whitespace when it comes from copying an identifier. Do not remove meaningful spaces inside a reference. Case normalization can help matching, but it does not establish which record a person meant. The supplied editor uses a disclosed authoring locale. Function names stay in English, while decimal punctuation and argument separators follow that setting. These exercises distinguish the input convention from the number the app stores.