.net - Format any currency and amount for current culture (not culture of the currency)

问题描述:

I need to format an amount in any given currency so that it looks as expected in the current culture.

For example in UK culture (en-GB) one would expect to see the following:

1.00

$1.00

1.00

And in German culture, the same currency amounts should appear as:

1,00

1,00 $

1,00

I have found a method (below) which formats the currency/amount according to the format of the culture associated with the currency (e.g. 1.00, 1,00 ) but this is not quite right, as someone from the UK would expect to see 1.00 even though Euro is not the currency associated with en-GB.

Can anyone provide or describe a method to view an amount in any given currency according to the current culture?

网友答案:

To set the current symbol to the desired one (, $, or whatever else) while still using the other attributes of the current culture, you can just clone your current NumberFormatInfo and replace the currency symbol: