viernes, 22 de junio de 2018

C# Recipe 3: How to format a string as currency

You can use the String.Format() method to localize the format of data such as dates,times, numbers, and currencies, according to the culture in the currently executing thread. The following example shows how to display a currency according to the current culture.

Fig 1. Example of how strings are formatted.


Fig 2. Displays a localized currency value.


Download source code.