How to show NSDecimal with custom format? Something like "% .2f" or "% .4f". NSDecimalString just throws zeros (e.g. 4.10 becomes 4.1).
[NSString stringWithFormat:@"%.2f", [[NSDecimalNumber decimalNumberWithDecimal:myDecimal] doubleValue]]
Alternatively, consider NSNumberFormatter .
Source: https://habr.com/ru/post/1344275/More articles:How to use Java Facelets as a generic template engine in a standalone application? - javaCheck if a class from a class variable (metaclass) is a TMyClass variable - metaclassIPhone Address Book: How do I get a list of only contacts with phone numbers? - filterC # generic type not assigned - genericsProblem using PIL in a Django application on Windows - pythonHow to make this thread safe - thread-safetySlow polling of touch messages on Android via browser and native application - javascriptHow to get 64x64 file type / extension icon in C #? - c #How to track a leak of a Windows USER object? - c ++How to calculate the length (in pixels) of a string in JavaScript? - javascriptAll Articles