Search

Index

Revindex Storefront

How to format the currency symbol

Currency symbol is determined by your Web site's selected language (also better known as culture) and the matching currency configured in your Storefront's Configuration > Currencies settings.

For example, if your site displays in both in English (U.S) and French (France) languages, and you have configured your Storefront's currency settings to match both languages, the currency symbol displayed will be "$" and "€" respectively. If, however, you only enabled English (U.S) in your Storefront's currency settings, the system will automatically fallback to the primary currency.

The desired currency format is determined by your Price display mode under Configuration > General settings. If your Price display mode is set to "Show price", the system expects that you will only display prices without taxes. In certain countries such as in Europe, you are required by law to display the prices with taxes included. In this case, you must set your Price display mode to "Show price tax inclusive" to notify the system to automatically calculate the applicable taxes immediately.

To control the currency format, you can do so through the static localization from the site Settings > Site Settings and edit the static localization for your language. Then drill down to the node and look for the Format.Currency.Text for "Show price" mode and Format.CurrencyTaxInclusive.Text values for "Show price tax inclusive" mode.

Local Resources
    DesktopModules
        Revindex.Dnn.RevindexStorefront
            App_LocalResources
                SharedResources


The {0} token is replaced with the currency code, the {1:c} token is replaced with the amount with currency symbol and the {2:c} token is replaced with the amount tax included with currency symbol. Depending on how you configured your Configuration > General price display settings, it will use one of the two formats.

For example, the following currency format "{0} {1:c}" will display "USD $8.88". If you want to omit the "USD" currency code, simply change the format to "{1:c}" and it will print a shorter "$8.88".

Similarly, the currency format for tax included prices of "{0} {1:c} ({2:c} tax incl)" will display "USD $8.88 ($9.20 tax incl)". You can shorten the format to "{2:c}" if you simply want to print "$9.20". 

You can find more information about string formatting here:

http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx 

Comments


Powered by Revindex Wiki