开发者

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

开发者 https://www.devze.com 2023-03-19 13:47 出处:网络
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

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

精彩评论

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

关注公众号