oscarimonbox
5/30/2016 - 7:17 AM

Redondear a X0 / X0.5 / X1

Redondear a X0 / X0.5 / X1

-(float) roundNumerToFraction: (float) number {
    float roundedValue = round(2.0f * number) / 2.0f;
    NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    [formatter setMaximumFractionDigits:1];
    [formatter setRoundingMode: NSNumberFormatterRoundDown];
    
    return roundedValue;

}