|
|
How Do I...Display Multiple Currencies (the Euro and local currency)?This sample illustrates how to use multiple currencies such as the Euro and German DM (Deutsch mark) in your application.
The System.Globalization.NumberFormatInfo class contains formatting information such as the currency symbol, decimal digit, separator, and so on. In many European countries, two separate currencies are commonly used: the Euro and the local currency. A static property NumberFormatInfo.CurrentInfo contains current local currency info, and the Currency symbol that is associated with the Euro. To represent the local currency and the Euro, you must first create a copy of the NumberFormatInfo instance using NumberFormatInfo.Clone(), then replace the CurrencySymbol property with the local currency symbol.
Dim LocalFormat As NumberFormatInfo = CType(NumberFormatInfo.CurrentInfo.Clone(), NumberFormatInfo) LocalFormat.CurrencySymbol = "DM" ' Replace currency symbol with DM symbol. VB
Example
|