Adding large Power values in Xcode

前端 未结 2 1662
南旧
南旧 2021-01-28 14:33

I am new to Objective C and iPhone development.

I\'m working with a basic calculator. I want to add a large value in text field. How can I display large values like this

2条回答
  •  情歌与酒
    2021-01-28 14:47

    Use Double data type. And then convert it into string then pass that string to your textField.

    For eg:-

    double result;
    NSString *strResult = [[NSNumber numberWithDouble:result] stringValue];
    

    It will give you exponential string.

    And instead of a UILabel use UITextField.

提交回复
热议问题