Globalization: the wrong format is used in the Portugal locale

2 posts, 0 answers
  1. Denys
    Denys avatar
    1 posts
    Member since:
    Nov 2020

    Posted 24 Nov 2020 Link to this post

    Greetings.
    Globalization functionality has been added in a project I am working on.During development, it was discovered that the Portuguese locale ("pt-pt") is not using the correct format for decimals. According to https://en.wikipedia.org/wiki/Decimal_separator, portuguese format should be "1 234 567,89", but the format looks like this "1.234.567,89". Looks like Brazilian format ("pt") is being used instead of Portuguese ("pt-pt").

    Stackblitz example with kendo-numerictextbox : https://stackblitz.com/edit/angular-grmrwk?file=app/app.module.ts

    Can you please clarify if this is normal behavior?
    Thank you.

  2. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    1292 posts

    Posted 25 Nov 2020 Link to this post

    Hello Denys,

    To use the pt-PT locale specific formatting, the corresponding info should be imported, and the locale ID should be set accordingly, e.g.:

    import '@progress/kendo-angular-intl/locales/pt-PT/all';
    ...
    providers:    [{
          provide: LOCALE_ID, useValue: 'pt-PT'
        }]

    https://stackblitz.com/edit/angular-grmrwk-bx7zpu?file=app%2Fapp.module.ts // pt-PT

    https://stackblitz.com/edit/angular-grmrwk-c7srbg?file=app%2Fapp.module.ts // pt

    I hope this helps.

    Regards,
    Dimiter Topalov
    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/.

Back to Top