Xcode:带逗号的点号 [英] Xcode : Number pad with point for comma

查看:114
本文介绍了Xcode:带逗号的点号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有完成按钮的数字键盘。但是用户只能选择没有逗号的数字。所以我有一个方法有一个数字垫与donebutton(我有),整合与标点,或至少一个点为逗号?
谢谢! ;)

I have a number pad with done button. But the user can only choose numbers without comma's. So i there a way to have a number pad with donebutton (wich I have) , integreted with punctation , or at least a point for the comma ? Thanks ! ;)

推荐答案

你的问题暗示你正在做一些格式化的数字。这似乎是一个安全的假设,你将使用固定数目的小数位(因为它是更常见的看到带有固定小数位数的格式化的数字比没有)。

Your question implies that you're doing to be doing some formatted number. It would then seem like a safe assumption that you're going to be working with a fixed number of decimal places (as it is more common to see a formatted number with a fixed number of decimal places than without).

如果是这样,则不需要使用按钮。你可以从固定数目的小数位置开始,并移动东西。例如,假设您要输入数字4,238.07。

If this is true, then you don't need the . or , buttons at all. You could just start with the fixed number of decimal places and shift stuff over. For example, let's say you want to type the number "4,238.07".

______.__  //type 4
______._4  //type 2
______.42  //type 3
_____4.23  //type 8
____42.38  //type 0
___423.80  //type 7
_4,238.07

这篇关于Xcode:带逗号的点号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆