Trouble storing taxes in Core Data that are to three decimal points.
Trouble storing taxes in Core Data that are to three decimal points.
- Subject: Trouble storing taxes in Core Data that are to three decimal points.
- From: Mike Zornek <email@hidden>
- Date: Sat, 20 Jan 2007 06:09:05 -0500
In the 1.1 release of my Cocoa Core Data app I added tax support. It's a
fairly generic implementation in that it's two tax 'slots', each with a
customizable label(NSString) and rate(NSDecimalNumber). I use
NSDecimalNumber because this is a number that will be in math with my other
totals (also NSDecimalNumbers) and I want precise math. I've lived in float
math accounting before in other apps and it was scary.
In testing my implementation worked great and so we released the whole
upgrade on Monday. Throughout the week I've gotten now two emails from users
in Hawaii and Texas that are complaining because their local tax rate is to
three decimal places, ie: 2.125% or 6.233%.
Looking at the NSDecimalNumber docs it would seem I can manually create an
NSDecimalNumber with a remainder to three places via
`decimalNumberWithMantissa:exponent:isNegative:` but I'm not sure how this
might interact with Core Data or how I might go about upping the precision.
Any thoughts?
~ Mike
--
Work: http://ClickableBliss.com
Play: http://MikeZornek.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden