Round to (1, 2, or 5) x 10^n in Objective-C?

Viewed 1229

Is there a simple way of rounding a value either down to or to the nearest (1, 2, or 5) x 10^n where n is an integer? As in one of {..., .05 .1, .2, .5, 1, 2, 5, 10, 20, 50, 100...}

Thanks.

4 Answers
Related