core-data

Core Data - Decimal Type for Currency

早过忘川 提交于 2020-08-26 16:32:07
问题 I read in a recent post that the Decimal data type is the best to use in Core Data to model currency since it doesn't have floating point issues. I've searched the apple docs and google and can't seem to find any documentation on using the Decimal type. Does anyone have a link to documentation on it? Thanks! 回答1: Use "Decimal" as the attribute type in your data model and NSDecimalNumber as the object type in your code. 回答2: The 'decimal' type in Core Data relates to the Cocoa type

Core Data - Decimal Type for Currency

三世轮回 提交于 2020-08-26 16:29:13
问题 I read in a recent post that the Decimal data type is the best to use in Core Data to model currency since it doesn't have floating point issues. I've searched the apple docs and google and can't seem to find any documentation on using the Decimal type. Does anyone have a link to documentation on it? Thanks! 回答1: Use "Decimal" as the attribute type in your data model and NSDecimalNumber as the object type in your code. 回答2: The 'decimal' type in Core Data relates to the Cocoa type