In Objective C, is there any way to format an integer to ordinals
1 => “1st”, 2 => “2nd” etc… that works for any language?
So if the user is French he will see “1er”, “2ieme” etc..
Thanks a lot!
Edit:
This is for an iOs app
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.
Have you taken a look at
TTTOrdinalNumberFormatterwhich is inFormatterKit? It works great, and I’m pretty sure it’s exactly what you’re looking for.Here’s an example taken from the kit:
Assuming you’ve provided localized strings for “You came in %@ place!”, the output would be: