Re: Temperatur etc. from Locale


Andy Lee
 

I haven't played with it myself, but maybe NSMeasurementFormatter?

--Andy

On Sep 24, 2018, at 2:35 AM, Gerriet M. Denkmann <g@...> wrote:

I want to know, given a certain NSLocale (e.g. NSLocale.currentLocale), how to represent:

Temperature (K, °C or whatever)
Distance (km, miles, furlongs, lightyears, … )
Speed (m/sec, km/h, …)
Frequency (rpm, U/min, Hz, … )

The only thing I did find out is that my locale uses NSLocaleMeasurementSystem = Metric .

Is the Locale the right place to look for this information?

There is Unicode Common Locale Data Repository, which claims to be used by “Apple (macOS, iOS, watchOS, tvOS, and several applications; Apple Mobile Device Support”.

But I did not find anything about temperature etc.

Gerriet.




Join {cocoa@apple-dev.groups.io to automatically receive all group messages.