6fagba
Last Updated: February 25, 2016
·
352
· mteece

Objective-C round double to nearest 50

// Nearest 50 is another useful example, 1150 result. Also needs floor().
double pos = 1157.483277;
int nf = 50.0 * floor((pos/50.0)+0.5);