You made simple mistake. This will work:
[NSString stringWithFormat: @"%.2lf", total]
More Related Contents:
- Mixing C functions in an Objective-C class
- What is double star (eg. NSError **)?
- Why does NSError need double indirection? (pointer to a pointer)
- Getting date from [NSDate date] off by a few hours
- How to format a number from 1123456789 to 1,123,456,789 in C?
- Objective-C : BOOL vs bool
- How to split a string literal across multiple lines in C / Objective-C?
- How to format a number using comma as thousands separator in C?
- Rounding numbers in Objective-C
- Generate a random number within range? [duplicate]
- Objective-C sample code for HMAC-SHA1 [closed]
- Variably modified array at file scope
- Checking the size of an object in Objective-C
- string format for intptr_t and uintptr_t
- Use C++ with Cocoa Instead of Objective-C?
- Left-pad printf with spaces
- Objective C: SHA1
- Is it ok to use “classic” malloc()/free() in Objective-C/iPhone apps?
- Variable sized padding in printf
- How can I avoid “duplicate symbol” errors in xcode with shared static libraries?
- Convert objective-c typedef to its string equivalent
- Advantage and disadvantages of #define vs. constants? [duplicate]
- What are scanf(“%*s”) and scanf(“%*d”) format identifiers?
- How can I break out of two nested for loops in Objective-C?
- I need help understanding this code in C [closed]
- srand() — why call it only once?
- An example of use of varargs in C
- sizeof single struct member in C
- Can’t step into string.h function with GDB
- Mac Mountain Lion send notification from CLI app