0

In Windows, ideally using the .NET framework, is there a way to determine the normal units of measure (e.g., SI/metric vs. Imperial/US/English)? If possible I assume this would be related to the PC's locale settings in some way.


Similar to:

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81

1 Answers1

3

There's the IsMetric property on the RegionInfo class.

var us = new RegionInfo("US");
Console.WriteLine($"Is {us.Name} Metric: {us.IsMetric}");

var nl = new RegionInfo("NL");
Console.WriteLine($"Is {nl.Name} Metric: {nl.IsMetric}");

Prints:

Is US Metric: False
Is NL Metric: True
CodeCaster
  • 147,647
  • 23
  • 218
  • 272