I'm trying to save a float like so
[NSNumber numberWithFloat:[dosage floatValue]];
and read the value like so:
dosage = [NSString stringWithFormat:@"%1.0f", [prop.dosage floatValue]];
The Problem is that numbers like 0.11 end up being 0
I've read that I can use NSNumberFormatter
, but the docs are not very clear on how to set it for rounding.