• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDecimalRound
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDecimalRound


  • Subject: Re: NSDecimalRound
  • From: Jonathan Jackel <email@hidden>
  • Date: Sun, 30 Nov 2003 07:45:34 -0500

NSDecimal is a struct, not an object. NSRange, NSPoint, and NSRect are also structs, so this is not at all uncommon.

NSDecimalNumber is an object that wraps NSDecimal in Objective C. If you want a number object (say, to put in an NSArray or NSDictionary) and you want to do math with it (including rounding), use NSDecimalNumber.

Jonathan

On Nov 30, 2003, at 3:29 AM, Jay Rimalrick wrote:

here is a function that looks like it will do the job for me

void NSDecimalRound(NSDecimal* result, const NSDecimal* number, int scale,
NSRoundingMode mode);


however I am not sure how you actually get NSDecimal data types.

I tried

NSDecimal* myDecimal = [[NSDecimal alloc] init];

and i get the error "NSDecimal is not an objective-c class"

how am i to use the function if NSDecimal is not a class?

thanks in advance
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSDecimalRound (From: "Jay Rimalrick" <email@hidden>)

  • Prev by Date: Hypothetical NSTreeController and NSOutlineView with bindings
  • Next by Date: Re: more float rounding info
  • Previous by thread: Re: NSDecimalRound
  • Next by thread: How to rename/move project directory?
  • Index(es):
    • Date
    • Thread