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

Force 2 Decimal Places For all NumericTextBoxes

1 Answer 2292 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Zee
Top achievements
Rank 1
Zee asked on 27 Mar 2021, 12:48 PM

Hi,

How do I set the default number of decimal places for all "NumericTextBoxes" to 2. 

Currently all NumericTextBox decimal places are default to 3.

 

I have multiple Grids with decimal columns which can be edited Inline. 

 

<GridColumn Field="@nameof(Item.Price)" Title="Price" DisplayFormat="{0:N2}"  />

 

All numeric textboxes in edit mode are set to 3 decimal places.

Why is the default three decimal places?

 

 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 29 Mar 2021, 06:56 AM

Hello Zee,

The Format (for example, currency), decimal separator, group separator and default number of Decimals are taken from the current culture. Thus, whether it will default to 2 or 3 decimals is up to the app. You can read more on how our components handle the culture of the app here.

That aside, you can set the Format and Decimals parameters of the numeric textbox as required by your app and set the decimal places there, instead of relying on the app culture. To do that in a grid, use the editor template of the column.

Regards,
Marin Bratanov
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.

Tags
NumericTextBox
Asked by
Zee
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or