如何检测 iOS 区域设置中数字在整体和数字之间使用逗号而不是句点的位置小数部分?
我有一个特殊要求,即了解当前区域设置是使用基于逗号的数字还是基于句点的数字。有没有简单的方法可以学习这个?
I have a special requirement to learn whether the current locale uses comma-based or period-based numbers. Is there a simple way to learn this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将返回当前分隔符。我用它来生成有效的 CSV 文件。
Will return current separator. I use it for generating valid CSV files.
我建议看一下 NSNumberFormatter 类:
NSNumberFormatter 类参考
通过 CoreFoundation 执行此操作的编程指南:
数据格式化编程指南
很高兴您花时间在这上面,在我的应用程序中我使用了自己的时间戳格式,而系统允许您选择你自己的时间戳格式......不用说我有一些愤怒的用户。
I suggest taking a look at the NSNumberFormatter class:
NSNumberFormatter class reference
Programming guide on doing this through CoreFoundation:
Data formatting programming guide
Its good that you are spending time on this, in my application I made use of my own timestamp format, while the system allows you to pick your own timestamp format... needless to say I had some angry users.