NSDecimalNumber zeros following decimal point (iPhone SDK)

前端 未结 2 1200
醉话见心
醉话见心 2021-02-09 23:35

I have the following code

(...)
numberStyle = [NSDecimalNumberHandler decimalNumberHandlerWithRoundingMode:NSRoundPlain
                                                  


        
2条回答
  •  生来不讨喜
    2021-02-10 00:19

    Why not use textFieldThree.text=[NSString stringWithFormat:@"%.2f",[fieldOneDN floatvalue]];

    (or something similar - sorry I'm on a PC right now so can't test this)

提交回复
热议问题