Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > NumericTextBox > Change decimal digits in jquery?

Not answered Change decimal digits in jquery?

Feed from this thread
  • bseels avatar

    Posted on Jan 27, 2012 (permalink)

    I have a NumericTextBox that I need to change the decimal digits based on the value of a selection of a combobox.  How do I change the decimal digit value within jquery? 

    For example, if the user selected "Decimal 1" from the combobox, I need the number of decimal digits to be 2.  If "Decimal 2" is selected, I need the number of decimal digits to be 5.

    Is this possible to do in jquery?

    Reply

  • Georgi Krustev Georgi Krustev admin's avatar

    Posted on Jan 31, 2012 (permalink)

    Hello Brooke,

     
    Thank you for contacting us. Yes you can accomplish this task using JavaScript:

    function setDecimals(digits) {
       var textbox = $("#NumericTextBox").data("tTextBox");
       
       //set the decimal digits
       textbox.digits = digits;
     
       //set value in order to re-format the number
       textbox.value(textbox.value());
    }

    Regards,
    Georgi Krustev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > NumericTextBox > Change decimal digits in jquery?
Related resources for "Change decimal digits in jquery?"

ASP.NET MVC NumericTextBox Features  |  Documentation  |  Demos  |  Telerik TV ]