Limit a double to two decimal places [duplicate]

You made simple mistake. This will work:

[NSString stringWithFormat: @"%.2lf", total]

Leave a Comment