I am planing to have dropdown where you can select your desired currency. I would like to format it like this: EUR €. Is there a way to get the currency symbol? I have looked around a bit, but only manged to find the .FormattedAmount() wich won't quite work. Or do I have to do something janky like using .FormattedAmount() and then treat the value like a string to then get the symbol?
If you want to format your prices everywhere as EUR € you could set this as your currencies format template in the currency settings with a value of EUR €{0:0.00} which I think should work meaning all prices coming from FormattedAmount() would be in this format.
Alternatively, you'll have to get the culture info of the currency and then access the currency symbol from there
var culture = CultureInfo.GetCultureInfo(cultureNameFromCurrency);
var symbol = culture.NumberFormat.CurrencySymbol;
Get currency symbol
Hi!
I am planing to have dropdown where you can select your desired currency. I would like to format it like this:
EUR €
. Is there a way to get the currency symbol? I have looked around a bit, but only manged to find the.FormattedAmount()
wich won't quite work. Or do I have to do something janky like using.FormattedAmount()
and then treat the value like a string to then get the symbol?//Johannes
Hi Johannes,
If you want to format your prices everywhere as
EUR €
you could set this as your currencies format template in the currency settings with a value ofEUR €{0:0.00}
which I think should work meaning all prices coming fromFormattedAmount()
would be in this format.Alternatively, you'll have to get the culture info of the currency and then access the currency symbol from there
Hope this helps
Matt
Hi Matt!
Did the trick! Thanks :)
//Johannes
is working on a reply...