numeric values in arabic

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 Jahre weitere
Hi..please anyone can suggest that how can we show numbers like price etc in arabic locale because after switching to arabic language numeric values still showing in english only

Needed Urgent suggestion please
6 Jahre weitere
Following this document, scroll-down to section



About Default Currency setting
~~~
Default currency for a specific language. If not specified, then the first found one (with the lowest display order) will be used.
~~~
Did you set your currency based on your selected language or leave it as default?
6 Jahre weitere
Hi,

Thanks for prompt reply

yes i have setup already as you suggested and currency locale also set to Ar-ae as required but still numeric values comes in English after switching to Arabic language
6 Jahre weitere
What is the format you wanted to display?
6 Jahre weitere
For example, if the number is 100, it will be displayed like

١٠٠٫٠٠ د.إ

Is that right?
6 Jahre weitere
want to display arabic numerals like 1 in arabic display like ١ and 2 like ٢
6 Jahre weitere
ima9ines wrote:
For example, if the number is 100, it will be displayed like

١٠٠٫٠٠ د.إ

Is that right?


Yes exactly the same I need to achieve
6 Jahre weitere
You could try that:

* Open _Root.Head.cshtml view to modify
* Add following javascript code (underlined)

...
<body>
    @RenderBody()
    @Html.NopCssFiles(this.Url, ResourceLocation.Foot)
    @Html.NopScripts(this.Url, ResourceLocation.Foot)
    <script type="text/javascript">
        $(document).ready(function () {
            $('span.price').each(function (index, elem) {
                var $elem = $(elem),
                    number = $elem.text().replace('د.إ.', '').trim(),
                    formatedNumber = Number.parseFloat(number).toLocaleString('ar-AE', { style: 'currency', currency: 'AED' });

                $elem.text(formatedNumber);
            });
        });
    </script>

</body>
</html>


The result

6 Jahre weitere
Hi,

Thanks a lot for help its achieved maximum but still there is one issue only that i want numeric value have to switch back to english when someone select language english but its showing arabic numerals for all languages

thanks a lot for great help as just needed small help on above one also
6 Jahre weitere
Try that


    @{
        var workContext = EngineContext.Current.Resolve<Nop.Core.IWorkContext>();
        var currencyAR = workContext.WorkingCurrency.CurrencyCode == "ar";
    }
    @if (currencyAR) {
        <script type="text/javascript">
            $(document).ready(function () {
                $('span.price').each(function (index, elem) {
                    var $elem = $(elem),
                        number = $elem.text().replace('د.إ.', '').trim(),
                        formatedNumber = Number.parseFloat(number).toLocaleString('ar-AE', { style: 'currency', currency: 'AED' });

                    $elem.text(formatedNumber);
                });
            });
        </script>
    }
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.