FORCE USE FORMAT US FOR SPANISH LOCALE USING ANGULAR?

1 Answer 89 Views
FormField NumericTextBox
Roman
Top achievements
Rank 1
Roman asked on 03 Oct 2024, 01:37 PM
I have a question on this, i have a service in my application that is switching the language of website (including this
(<CldrIntlService>this.intlService).localeId = language;
Also i have some kendo-numerictextbox in my project that need to be force set to USA currency format always, how can i achieve this.

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 07 Oct 2024, 11:15 AM

Hello Roman,

Yes, the developer can change the default locale numeric format and for example, change the default Spanish currency format to the USA one.

For example, here is the Spanish default currency and numeric formats:

and the en-US currency and numeric formats:

In order to change the default Spanish currency format, change the default locale settings following this article:

https://www.telerik.com/kendo-angular-ui/components/globalization/internationalization/loading-data#modifying-the-locale-data

Here is an example:

const esData: Locale = localeData('es');
esData.numbers['currency'].patterns = ['$n'];

https://stackblitz.com/edit/angular-dh8uru?file=src%2Fapp%2Fapp.module.ts,src%2Fapp%2Fapp.component.ts

I hope this helps.

Regards,
Martin Bechev
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Roman
Top achievements
Rank 1
commented on 07 Oct 2024, 01:37 PM

Hello Martin.
I've already fix this, by my own. Never the less, thank you very much for your time and a good reply, have a nice day :)
Martin Bechev
Telerik team
commented on 08 Oct 2024, 07:30 AM

Hi Roman,

If you have the time and willingness, share your experience and the way you implemented it. It might be found helpful for others.

Regards

Tags
FormField NumericTextBox
Asked by
Roman
Top achievements
Rank 1
Answers by
Martin Bechev
Telerik team
Share this question
or