• 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: rounding a float
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rounding a float


  • Subject: Re: rounding a float
  • From: Steve Bird <email@hidden>
  • Date: Sat, 29 Nov 2003 20:22:32 -0500

On Nov 29, 2003, at 7:40 PM, j o a r wrote:

> How about (man round):
>
> float myRoundedFloatValue = roundf(myFloatValue);

--- Won't get it done. 1.255 and 1.254 both round to 1.00 in your
scenario.


> j o a r
>
> On 2003-11-30, at 01.17, Jay Rimalrick wrote:
>
>> What is the easiest way to round a float value with either c or
>> objective-c. I
>> need this float value to be consistent with the rounding of currency
>> e.g.
>> 1.255 rounds to 1.26 and
>> 1.254 rounds to 1.25
>>
>> any and all help is greatly appreciated.
----------------------------------------------------------------
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175
_______________________________________________
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: 
 >rounding a float (From: "Jay Rimalrick" <email@hidden>)
 >Re: rounding a float (From: j o a r <email@hidden>)

  • Prev by Date: Eaves dropping on application events
  • Next by Date: Re: do periodic NSTask yet allow sleep?
  • Previous by thread: Re: rounding a float
  • Next by thread: Re: rounding a float
  • Index(es):
    • Date
    • Thread