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

Number format without decimals

1 Answer 887 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 10 Mar 2015, 04:36 PM
Hello.  I would like this to work.  I know that format: 'g' will give me a number without decimals, but then it doesn't have a comma separator.  
Thank you.

$('.numeric').kendoNumericTextBox({
        format: "n",
        decimals: 0
    });

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 12 Mar 2015, 08:19 AM
Hello Robert,

The desired format can be accomplished using custom numeric formats available in Kendo UI. The custom format that displays the numbers in "g" format is "#.#":
$('.numeric').kendoNumericTextBox({
  format: "#.#",
  decimals: 0
});
You can find more details about the support formats in this help topic.

Regards,
Georgi Krustev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
NumericTextBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or