Change currency symbol without changing the locale

6 posts, 1 answers
  1. Arthur
    Arthur avatar
    4 posts
    Member since:
    Jun 2020

    Posted 18 Sep Link to this post

    I would like to change the currency symbol globally, not per pipe/function or component.

    So in my case I want to display amounts in "€", but the application's locale should be the default one (en-US).

    I did not found anything in the documentation, any ideas?

  2. Ivan
    Admin
    Ivan avatar
    33 posts

    Posted 22 Sep Link to this post

    Hello Arthur,

    Though the question is not related to KendoAngular components, would suggest to use some kind of Singleton service , which will hold the value of currency ( which is global for the app ) and will be updated according to user preferences. This value can be then used in UI with some kind of directive or component that will take care for updating and displaying it.

    I hope this will help you.

    Regards,
    Ivan
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

  3. Arthur
    Arthur avatar
    4 posts
    Member since:
    Jun 2020

    Posted 22 Sep in reply to Ivan Link to this post

    Hello Ivan,

    is the currency symbol tied to the locale, so I can only change the locale globally or provide the currency symbol in the pipes via the format option?

     

  4. Ivan
    Admin
    Ivan avatar
    33 posts

    Posted 24 Sep Link to this post

    Hi Arthur,

    It is not out of the box solution , but you can do something like in this stackblizt sample.  There is other more robust way, which involves defining new locale and using it as variant of your locale. We will consolut with the core team for this implementation and will follow you back.

    Regards,
    Ivan
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

  5. Answer
    Ivan
    Admin
    Ivan avatar
    33 posts

    Posted 24 Sep Link to this post

    Hello Arthur,

    Just to follow you up with other way to achieve the desired behaviour, just use

    intlService.formatNumber(number, customCurrencyOptions)

    like in this stackblitz sample.

    Regards,
    Ivan
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  6. Arthur
    Arthur avatar
    4 posts
    Member since:
    Jun 2020

    Posted 16 Oct in reply to Ivan Link to this post

    Thanks
Back to Top