How do i get the currency pattern for a specific culture?
For Example:
Instead of using:
string.Format(\"{0:c}\", 345.10)
I
I think what you're asking is how to change the currency symbol but keep the culture-specific formatting. You can do this by getting a copy of the current NumberFormatInfo
and modifying the CurrencySymbol
property:
Thread.CurrentThread.CurrentCulture = new CultureInfo("de");
// pretend we are german
var nfi = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
nfi.CurrencySymbol = "$$$";
Console.WriteLine(string.Format(nfi,"{0:c}",345.10));
This will output:
345,10 $$$
Without changing the CurrentCulture
it outputs (for me):
$$$345.10