Setting displayable decimal places using data-attribute initialization

2 posts, 0 answers
  1. Robert
    Robert avatar
    39 posts
    Member since:
    Oct 2012

    Posted 28 Jun 2013 Link to this post

    If I understand numerictextbox correctly, the decimals property allows me to set how many decimal places are shown; if I understand data-attribute initialization correctly, I can set the decimals property use data-decimals="num"

    I have the following numerictextbox:

                   <input data-role="numerictextbox" value="15.284123" data-decimals="6" data-step="0.01"/>

    I only see the value "15.28" displayed.  How can I get all 6 decimal places to be displayed
    http://jsfiddle.net/raltman/W48Em/5/

    Thanks.
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 01 Jul 2013 Link to this post

    Hello Robert,

     
    The decimals option controls the NumericTextBox value precision. In other words, if the decimals is set to 6, the widget will persist the value fraction up to the sixth digit. In order to change number formatting you will need to define the format of the widget:

    <input data-role="numerictextbox"
            value="15.284123"
            data-decimals="6"
            data-step="0.01"
            data-format="n6"
        />
    For more information about numeric formats check 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!
  3. Kendo UI is VS 2017 Ready
Back to Top