Is their a built-in way of formatting string as $ price, e.g. 12345.45 converted to $12,345.45?
Is their a built-in way of formatting string as $ price, e.g. 12345.45 converted
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming you are using Cocoa (or just Foundation), you can use NSNumberFormatter and set its style to currency:
By default it uses the locale of your system, but you can change that and lots of other properties, see the NSNumberFormatter API docs.