• 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: Another newbie question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another newbie question...


  • Subject: Re: Another newbie question...
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 28 Jan 2002 20:41:18 -0800

There are C functions called floor(), ceil() rint() and the like
that round to integers in various ways. If you're going to be
doing accounting calculations, have a look at the
NSDecimalNumber class.

-jcr

On Monday, January 28, 2002, at 07:51 PM, email@hidden wrote:

> I may only need one person to answer this, but if I have a
> float/double and I want to round up the hundredths digit, can I
> do this with a simple C function? I tried a rounding 100*number
> to the nearest ones digit then returning back number/100, but
> it didn't work for some odd reason. I still got a whole lot of
> decimals like 4.05000000030001 or something like that...
>
> I hope someone can help, and please forgive my ignorance :-)
> -Kevin
> _______________________________________________
> 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.
>
>
"This is not a book to be tossed aside lightly. Rather, it
should be hurled with great force." -Dorothy Parker


References: 
 >Another newbie question... (From: email@hidden)

  • Prev by Date: Re: Visible at launch time?
  • Next by Date: Rounding up (Was Re: Another newbie question...)
  • Previous by thread: Re: Another newbie question...
  • Next by thread: Rounding up (Was Re: Another newbie question...)
  • Index(es):
    • Date
    • Thread