Decimal Numbers

2 posts, 0 answers
  1. StevenDom
    StevenDom avatar
    14 posts
    Member since:
    Aug 2014

    Posted 19 Mar 2015 Link to this post

    Hi all,

    I have a decimal field that I have bound to a MaskedTextbox. I have made the mask '999.99'. If I enter ' 45.77' I can see that 45.77 is saved in my database. When I refresh the screen and display the values again I see that '457.7 ' is shown in the MaskedTextbox. How do I get this to work properly and re-dispplay ' 45.77"?

    Thanks

    Steven
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 23 Mar 2015 Link to this post

    Hello Steven,

    MaskedTextBox works only with string values, hence the "45.77" value is formatted as string (from left to right) and that is why the displayed value is "457.7".

    In order to accomplish your goal, you will need to pad the value before setting it to the widget. In other words, you will need to create " 45.77" (notice the space) value before setting to the widget.

    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