15

Is it possible to get the unit of distance from a CultureInfo class or any other class in the System.Globalization namespace.

e.g. "en-GB" would be "mile", "en-FR" would be "km"

AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152

1 Answers1

20

RegionInfo.CurrentRegion.IsMetric

Forgotten Semicolon
  • 13,909
  • 2
  • 51
  • 61
  • 2
    Wow, never knew about this! Of course, it returns `true` for `en-GB`, and the asker indicates that "miles" (non-metric) would be preferred for that culture. – Cody Gray - on strike May 16 '11 at 16:40
  • 1
    Cody has a point, it returns true for "en-GB" would ahve expected it to return false... – AwkwardCoder May 16 '11 at 16:52
  • 1
    Although some country are using the metric system, many people still use what they learned before and use the imperial system. Here in canada, we are using metric most of the time, except when talking about someone size. e.g.: on the official paper, my size is 180cm, but when I talk about it, I always say that I'm 5.9'. It all come down to suggesting a default for your user, but allow him to change that setting. – Pierre-Alain Vigeant May 16 '11 at 20:05
  • 1
    In the UK, on the motorway (freeway), we use imperial measurements for long distances and metric for short distances! For example, signs will always give long distances in miles (London 56 miles) and short in meters (exit in 300m). Speed is always imperial (Mph) but weight is now metric! – George Filippakos Jan 28 '13 at 15:02