numeric values in arabic

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 6 años
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
Hace 6 años
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?
Hace 6 años
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
Hace 6 años
What is the format you wanted to display?
Hace 6 años
For example, if the number is 100, it will be displayed like

١٠٠٫٠٠ د.إ

Is that right?
Hace 6 años
want to display arabic numerals like 1 in arabic display like ١ and 2 like ٢
Hace 6 años
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
Hace 6 años
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

Hace 6 años
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
Hace 6 años
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.