iphone - objective-c round number to nearest 50 -


How do I make a number the nearest x value (for example 50)

i.e. 47 <50> <50> <50> <50> <50>

I do not really know how to do this how to start ... <

Using coco-touch for PS IoK

Many Thanks

Post-text "itemprop =" text ">

Do this:

  50.0 * floor ((number / 50.0) +0.5)  

Comments