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

发布于 2024-10-06 00:53:31 字数 302 浏览 0 评论 0原文


在我的应用程序中,可以存储每个对象的价格,用户还可以选择其首选货币。
在 iPhone SDK 中存储和管理带有货币的号码的最佳方式是什么?

有关我的应用的更多信息:
它使用核心数据。
可以存储的数字必须是xxx.xx类型(例如100.00)。
如何对这些数字进行升序或降序排序?
我必须在实体中设置什么样的属性才能存储这样的数字?

您有链接、文档、来源或指南来向我展示示例吗?我从来没有用货币来使用号码,那么我就遇到了一些问题:)

非常感谢,
马修

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?

More infos about my app:
It uses Core Data.
Number that can be stored must be of type xxx.xx (e.g. 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纸短情长 2024-10-13 00:53:31

使用转换系数将其存储在 GP(金币)中;)

看起来没有货币数据类型,因此存储数字和小数部分以及当前货币的设置可能与您一样好将会得到。请参阅:新手指南:在 iPhone 应用中管理货币

Store it in GP (gold pieces) with a conversion factor ;)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文