开发者

IOS: take a double value without two digits after the decimal point

I have a text field where I write a number; if开发者_如何学编程 I write inside this textfield a number without decimal point, I want to take this value and add a decimal point and two number after it

if I write (in textfield) "1" , I want to add ",00" then it becomes 1,00 if I write "1,8" , It becomes : "1,80" or if I write "2,86", It don't change : "2,86"

when I solve it I want to add this value in an array.


You should have a look into NSNumberFormatter.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜