resultDictionary[@"shidaon"]这是个什么对象?按理说%@能输出出来,那应该能把它的description赋给text

解决方案 »

  1.   


    感谢前辈! 用您的方法解决了!  _valueLab1.text=resultDictionary[@"shidaon"]  description再请教下:怎么把 resultDictionary[@"shidaon"]  转换为保留两位小数的数字值型值啊?我想把这值用进行加减运算:
    如:   float    aaf =resultDictionary[@"shidaon"]  +10.05     这样这写不正确,不知道应该怎样写? 请前辈帮写一下代码!
      

  2.   


    感谢前辈! 用您的方法解决了!  _valueLab1.text=resultDictionary[@"shidaon"]  description再请教下:怎么把 resultDictionary[@"shidaon"]  转换为保留两位小数的数字值型值啊?我想把这值用进行加减运算:
    如:   float    aaf =resultDictionary[@"shidaon"]  +10.05     这样这写不正确,不知道应该怎样写? 请前辈帮写一下代码!
    resultDictionary[@"shidaon"] 这字典里的值是怎么存进去的?是用@(...)这种方式吗?如果是的话:[resultDictionary[@"shidaon"] doubleValue] + 10.5
      

  3.   


    感谢前辈! 用您的方法解决了!  _valueLab1.text=resultDictionary[@"shidaon"]  description再请教下:怎么把 resultDictionary[@"shidaon"]  转换为保留两位小数的数字值型值啊?我想把这值用进行加减运算:
    如:   float    aaf =resultDictionary[@"shidaon"]  +10.05     这样这写不正确,不知道应该怎样写? 请前辈帮写一下代码!如果把 resultDictionary[@"shidaon"] 转成float类型,它的精度为6位,你可以在显示的时候控制它的小数位数
    转换:(这里的前提是这个里面有值,且为数值类型)
    float val = [resultDictionary[@"shidaon"] floatValue]; 
    val += 10.05;
    NSLog(@"output the value is %.2f", val);