Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

RegionInfo.IsMetric Property

Definition

Namespace:
System.Globalization
Assemblies:
mscorlib.dll, System.Globalization.dll
Assemblies:
netstandard.dll, System.Runtime.dll
Assembly:
System.Globalization.dll
Assembly:
System.Runtime.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
RegionInfo.cs
Source:
RegionInfo.cs
Source:
RegionInfo.cs
Source:
RegionInfo.cs
Source:
RegionInfo.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets a value indicating whether the country/region uses the metric system for measurements.

public:
 virtual property bool IsMetric { bool get(); };
public virtual bool IsMetric { get; }
member this.IsMetric : bool
Public Overridable ReadOnly Property IsMetric As Boolean

Property Value

true if the country/region uses the metric system for measurements; otherwise, false.

Examples

The following code example displays the properties of the RegionInfo class.

using System;
using System.Globalization;

public class SamplesRegionInfo {

 public static void Main() {

 // Displays the property values of the RegionInfo for "US".
 RegionInfo myRI1 = new RegionInfo( "US" );
 Console.WriteLine( " Name: {0}", myRI1.Name );
 Console.WriteLine( " DisplayName: {0}", myRI1.DisplayName );
 Console.WriteLine( " EnglishName: {0}", myRI1.EnglishName );
 Console.WriteLine( " IsMetric: {0}", myRI1.IsMetric );
 Console.WriteLine( " ThreeLetterISORegionName: {0}", myRI1.ThreeLetterISORegionName );
 Console.WriteLine( " ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName );
 Console.WriteLine( " TwoLetterISORegionName: {0}", myRI1.TwoLetterISORegionName );
 Console.WriteLine( " CurrencySymbol: {0}", myRI1.CurrencySymbol );
 Console.WriteLine( " ISOCurrencySymbol: {0}", myRI1.ISOCurrencySymbol );
 }
}

/*
This code produces the following output.

 Name: US
 DisplayName: United States
 EnglishName: United States
 IsMetric: False
 ThreeLetterISORegionName: USA
 ThreeLetterWindowsRegionName: USA
 TwoLetterISORegionName: US
 CurrencySymbol: $
 ISOCurrencySymbol: USD

*/
Imports System.Globalization


Public Class SamplesRegionInfo 

 Public Shared Sub Main()

 ' Displays the property values of the RegionInfo for "US".
 Dim myRI1 As New RegionInfo("US")
 Console.WriteLine(" Name: {0}", myRI1.Name)
 Console.WriteLine(" DisplayName: {0}", myRI1.DisplayName)
 Console.WriteLine(" EnglishName: {0}", myRI1.EnglishName)
 Console.WriteLine(" IsMetric: {0}", myRI1.IsMetric)
 Console.WriteLine(" ThreeLetterISORegionName: {0}", myRI1.ThreeLetterISORegionName)
 Console.WriteLine(" ThreeLetterWindowsRegionName: {0}", myRI1.ThreeLetterWindowsRegionName)
 Console.WriteLine(" TwoLetterISORegionName: {0}", myRI1.TwoLetterISORegionName)
 Console.WriteLine(" CurrencySymbol: {0}", myRI1.CurrencySymbol)
 Console.WriteLine(" ISOCurrencySymbol: {0}", myRI1.ISOCurrencySymbol)

 End Sub

End Class


'This code produces the following output.
'
' Name: US
' DisplayName: United States
' EnglishName: United States
' IsMetric: False
' ThreeLetterISORegionName: USA
' ThreeLetterWindowsRegionName: USA
' TwoLetterISORegionName: US
' CurrencySymbol: $
' ISOCurrencySymbol: USD

Applies to


Feedback

Was this page helpful?