iphone - How to round of CGFloat value -



iphone - How to round of CGFloat value -

possible duplicate: nsnumberformatter rounding float values

currently, calculate scaling factor using :

cgfloat scale = cgcontextgetctm(context).a; nslog(@"scale : %f", scale);

i receive floating point value : 0.124979, 0.249958, 0.499917. how can utilize roundf convert 0.125, 0.250, 0.500 respectively.

try this........

nslog(@"scale : %.3f", scale); nsstring *value = [nsstring stringwithformat:@"%.3f", thefloat];

stolen previous answer

iphone objective-c rounding cgcontext cgfloat

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

ms access - C# - Using OleDbParameter on table name -