I have very little programming knowledge; only a fair bit in Visual Basic.
How do I take a value from a text field, then do some simple math such as divide the value by two, then display it back to the user in the same field?
In Visual Basic you could just do txtBoxOne.text = txtBoxOne.text / 2
I understand this question is more than one question and is very basic stuff, but I need to get my head out of Visual Basic and into where I should be 🙂
You can use
doubleValueonNSStringobjects to retrieve the numeric value from a string.There are variations on this, such as
intValue,floatValue,boolValue, etc.I suggest that you stick with the primitive type that has the longest range (
double).For example: