This is a migrated thread and some comments may be shown as answers.

Globalization: the wrong format is used in the Portugal locale

1 Answer 62 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Denys
Top achievements
Rank 1
Denys asked on 24 Nov 2020, 03:06 PM

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.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 25 Nov 2020, 02:00 PM

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/.

Tags
General Discussions
Asked by
Denys
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or