• 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
Rounding to two decimals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rounding to two decimals


  • Subject: Rounding to two decimals
  • From: Ken Garden <email@hidden>
  • Date: Sat, 17 Jul 2004 23:14:25 +0200

Hi everyone,

I just joined the list and wanted to ask a simple beginner's question
to finish up my very first project in Cocoa. It's a simple app that
calculates the average of integers. This result (float type) often is
a decimal number with several digits. How can this float be limited
and rounded to two decimals?

I've tried the codes provided in the following page already, but
without success:
http://www.cocoadev.com/index.pl?RoundingFloatingPointValues

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.


  • Follow-Ups:
    • Re: Rounding to two decimals
      • From: Yann Bizeul <email@hidden>
  • Prev by Date: Re: NSValueTransformer - Object Reference
  • Next by Date: Rép : NSHost class
  • Previous by thread: Re: iChat perspective view
  • Next by thread: Re: Rounding to two decimals
  • Index(es):
    • Date
    • Thread