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

Decimal places

2 Answers 322 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Mac
Top achievements
Rank 1
Mac asked on 11 Aug 2015, 01:58 PM

At the following URL: http://demos.telerik.com/kendo-ui/numerictextbox/index

It shows 3 decimal places requested in the code 

// create Curerncy NumericTextBox from input HTML element
 
$("#currency").kendoNumericTextBox({ format: "c", decimals: 3});​

However, the display only shows 2.

Changing the decimals in the options seems to have no results in the Dojo.

My actual goal is to have no decimals, how can I do this?

2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 12 Aug 2015, 01:53 PM
Hello Calvin,

The format property of the widget will determine the display format and the decimals property will define the precision with which the value should be saved. 

As for your particular requirement you need to use "c0" in the format and remove the decimals property:
$("#currency").kendoNumericTextBox({
    format: "c0"
});

Hope this helps.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Mac
Top achievements
Rank 1
answered on 12 Aug 2015, 11:56 PM

Thanks Konstantin!

 May I recommend updating the demo so that it reflects that?

Tags
NumericTextBox
Asked by
Mac
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Mac
Top achievements
Rank 1
Share this question
or