Hi
I have 2 questions:
I have 2 questions:
- How can I allow a variable number of decimals? The user needs to be able to enter values such as: 1.23 or 1.236654 or 56. I need to disable/prevent any reformatting - it must just accept the number the user enters (of course still preventing non-numeric characters).
- Is there a way to dynamically update the number of decimals with javascript after the NumericTextBox has been defined?
Thanks
UPDATE: I figured out the first one by going to http://docs.kendoui.com/getting-started/framework/globalization/numberformatting. The following did the trick:
As a refinement to question 1, I would like to enforce a minimum number of decimal places (say 3). e.g. if the user enters: 3.4, it'll update it to 3.400, if the user enters 3.12345, then it should be left as is. I expected the format "0.000#################" to do this. It adds the zeros as required but it then goes on to round the number to 3 decimal places as well (as if I'd given the format "0.000"). This appears to be a bug?UPDATE: I figured out the first one by going to http://docs.kendoui.com/getting-started/framework/globalization/numberformatting. The following did the trick:
var numericTextBox = $(el).width(100).kendoNumericTextBox({
format: "#.############",
decimals: 10,
spinners: false
}).data("kendoNumericTextBox");