NSLocale and measurement systems

  • Hi,

    I need to present a distance in my interface either as kilometers or
    miles.

    There are two keys in NSLocale that indicate which measurement system
    the user prefers: NSLocaleUsesMetricSystem and
    NSLocaleMeasurementSystem.

    As a "native speaker of the metric system" I'm not really sure what
    to do with them.

    If NSLocaleUsesMetricSystem returns NO can I automatically assume
    american measurement units (i.e. usage of the statute mile)?

    What does NSLocaleMeasurementSystem return?

    Roddi

    P.S. What a mess: http://en.wikipedia.org/wiki/Mile
  • On Nov 13, 2007, at 9:58 AM, Ruotger Skupin wrote:
    > There are two keys in NSLocale that indicate which measurement
    > system the user prefers: NSLocaleUsesMetricSystem and
    > NSLocaleMeasurementSystem.
    >
    > As a "native speaker of the metric system" I'm not really sure what
    > to do with them.
    >
    > If NSLocaleUsesMetricSystem returns NO can I automatically assume
    > american measurement units (i.e. usage of the statute mile)?

    The short answer is yes. I won't bother with the long answer. :-)

    > What does NSLocaleMeasurementSystem return?

    A string (enum-like) representation of the same information. I believe
    the original thought was there might be choices other than "U.S." and
    "Metric", but that hasn't happened.

    Deborah Goldsmith
    Internationalization, Unicode Liaison
    Apple Inc.
    <goldsmit...>
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today