I want to show a localized string in iOS that supports the following outputs:
1 mile
1.5 miles
2 miles
1,5 miles
I can use a .stringsdict file to make the pluralization work in a way that is localizable. However, I want the number passed in to have a decimal part and I only want to show 0 or 1 decimal places. Furthermore, the number should be formatted based on locale (i.e. show the correct decimal separator).
It occurs to me the solution may take one of two forms, but I can't get either working:
- pass in a number representation to
stringsdictalongside a string representation - format the number inside the
stringsdictusing the IEEE printf specification