Reputation: 13007
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:
Upvotes: 0
Views: 435
Reputation: 151604
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
Upvotes: 3