简体   繁体   English

使用货币管理号码的最佳方法是什么?

[英]What is the best way to manage number with currency?


In my application it's possible to store a price for every object and the user can also choose its preferred currency. 在我的应用程序中,可以存储每个对象的价格,用户也可以选择其首选货币。
What is the best way to store and manage number with currency in iPhone SDK? 在iPhone SDK中使用货币存储和管理号码的最佳方法是什么?

More infos about my app: 关于我的应用的更多信息:
It uses Core Data. 它使用核心数据。
Number that can be stored must be of type xxx.xx (eg 100.00). 可以存储的数字必须为xxx.xx类型(例如100.00)。
How can I sort these numbers ascending or descending? 如何对这些数字进行升序或降序排序?
What kind of attribute I must set in my entity to store a number like this? 我必须在我的实体中设置什么样的属性才能存储这样的数字?

Have you got links, docs, source or guides to show me examples? 您是否有链接,文档,来源或指南向我展示示例? I never user number with currency, then I've got some problems with them :) 我从来没有使用货币的用户号码,然后我遇到了一些问题:)

Thanks a lot, 非常感谢,
Matthew 马修

Store it in GP (gold pieces) with a conversion factor ;) 将其存储在具有转换因子的GP(金币)中;)

It doesn't look like there's a datatype for currency, so storing the number and decimal part, and a setting for the current currency, is probably as good as you're going to get. 似乎没有货币的数据类型,因此存储数字和小数部分以及当前货币的设置可能与您要获得的一样好。 See this: HowTo for newbie: Managing currency in iPhone app 请参阅: 新手入门指南:在iPhone应用程序中管理货币

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS - 管理IBOutlets内存的最佳方法是什么? - iOS - What is best way to manage memory for IBOutlets? 在UITextField中验证货币输入的最佳方法是什么? - What's the best way to validate currency input in UITextField? 将杂乱数据管理到带有部分的UITableView上的最佳方法是什么? - What is the best way to manage messy data onto a UITableView with sections? 2个类似的iOS应用程序-管理它们的最佳方法是什么? - 2 similar iOS apps - what's the best way to manage them? 从iOS应用程序的主菜单管理9-15视图的最佳方法是什么? - What is the best way to manage 9-15 view from a main menu in an iOS app? 检测NSString中的单词是否有数字的最佳方法是什么? - what's the best way to detect if a word in NSString has a number? 在iPhone SDK中显示屏幕数量的最佳方法是什么? - What is the best way to display number of screens in iPhone sdk? 使用iPhone SDK管理可能巨大的照片库的最佳方法 - Best way to manage probably huge photo library with iPhone SDK 在iPhone 5和其他设备上管理屏幕高度差异的最佳方法 - Best way to manage screen height differences on iPhone 5 and others 使用openGL和cocos2D绘制大量行的最佳方法是什么? - What is the best way to draw a large number of lines using openGL and cocos2D?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM