Re: Creating NSDecimal
Re: Creating NSDecimal
- Subject: Re: Creating NSDecimal
- From: Graham Cox <email@hidden>
- Date: Fri, 31 Oct 2008 17:18:40 +1100
On 31 Oct 2008, at 5:08 pm, HAMILTON, Steven wrote:
Hi folks,
Can someone tell me how I create an NSDecimal? The C struct one,
not the ObjC NSDecimalNumber. For performance and simplicity I'd
rather use the C interface but for the life of me I can't find out
how to actually create one of these and assign a value to it.
\\Declare
NSDecimal *decimal;
\\assign<file:///\\assign>? Surely its not as simple as this?
decimal = 16.75
It does seem weird that there's no way to create a NSDecimal! I'm
pretty sure simple assignment won't work.
The only way I can see is something like this:
NSDecimal decimal = [[NSDecimalNumber
decimalNumberWithString:@"16.75"] decimalValue];
maybe that helps?
Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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