开发者

Take string from UITextField and use it as a double

I'm trying to make a unit converter as my first app. I've been having trouble getting the numeric value from the textfield, so I can multiply it by whatever constant to convert the units. Also, how ca开发者_运维问答n I add a decimal place to a numeric key pad?


Use the NSString doubleValue property to convert the string value from the UITextBox into a double.

double d = [str doubleValue];


float value = [self.myTextField.text floatValue];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜