RegionInfo.IsMetric Property
.NET Framework 1.1
Gets a value indicating whether the country/region uses the metric system for measurements.
[Visual Basic] Public Overridable ReadOnly Property IsMetric As Boolean [C#] public virtual bool IsMetric {get;} [C++] public: __property virtual bool get_IsMetric(); [JScript] public function get IsMetric() : Boolean;
Property Value
true if the country/region uses the metric system for measurements; otherwise, false.
Example
[Visual Basic, C#, C++] The following code example displays the properties of the RegionInfo class.
[Visual Basic] Imports System 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 'Main End Class 'SamplesRegionInfo '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 [C#] 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 */ [C++] #using <mscorlib.dll> using namespace System; using namespace System::Globalization; int main() { // Displays the property values of the RegionInfo for "US". RegionInfo* myRI1 = new RegionInfo( S"US" ); Console::WriteLine( S" Name: {0}", myRI1->Name ); Console::WriteLine( S" DisplayName: {0}", myRI1->DisplayName ); Console::WriteLine( S" EnglishName: {0}", myRI1->EnglishName ); Console::WriteLine( S" IsMetric: {0}", __box(myRI1->IsMetric)); Console::WriteLine( S" ThreeLetterISORegionName: {0}", myRI1->ThreeLetterISORegionName ); Console::WriteLine( S" ThreeLetterWindowsRegionName: {0}", myRI1->ThreeLetterWindowsRegionName ); Console::WriteLine( S" TwoLetterISORegionName: {0}", myRI1->TwoLetterISORegionName ); Console::WriteLine( S" CurrencySymbol: {0}", myRI1->CurrencySymbol ); Console::WriteLine( S" 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 */
[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button
in the upper-left corner of the page.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework
See Also
RegionInfo Class | RegionInfo Members | System.Globalization Namespace