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

Decimal Numbers

1 Answer 80 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
StevenDom
Top achievements
Rank 1
StevenDom asked on 19 Mar 2015, 09:03 PM
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

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 23 Mar 2015, 10:46 AM
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!
 
Tags
MaskedTextBox
Asked by
StevenDom
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or