Hi Experts,
I want to enter double values in the textbox. For this i am using UltraNumericEditor control.
If i enter 321.2685248, it should show 321.27 to the user but the value in the control should still retain the actual value 321.2685248.
Similarly, if i enter -1234.525897, it should show -1234.52 to the user, but the value in the control should still retain actual value -1234.525897
After the decimal, it should show only upto 2 numbers to the user but still retain the actual value. Please let me know what properties of UltraNumericEditor to be set.
Hi, Thanks for the reply. I modified the code as below
this.ultraNumericEditor1.Location = new System.Drawing.Point(12, 58);this.ultraNumericEditor1.Name = "ultraNumericEditor1";this.ultraNumericEditor1.NumericType = Infragistics.Win.UltraWinEditors.NumericType.Double;this.ultraNumericEditor1.Nullable = true;this.ultraNumericEditor1.PromptChar = ' ';this.ultraNumericEditor1.Size = new System.Drawing.Size(246, 21);this.ultraNumericEditor1.TabIndex = 1;
ultraNumericEditor1.MaskInput = "{double:-10.12}";ultraNumericEditor1.FormatString = ".##";
Below is the screenshot when the form is loaded and when i put my cursor inside the control. In second case, it displays 0.000000000000 by default . Is there any way to make it blank even after putting my cursor inside the control when i want to enter value?
Hello,
I modified my sample and attached it to the current post. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.
Hi, Thanks for the reply.
The sample code restricts the user to input only 3 numbers before decimal and 7 numbers after decimal point. But, i dont want this restriction. User should be able to input as many numbers as he can before and after decimal point. But, when the button is clicked, the textbox should show all the numbers before decimal and only 2 numbers after the decimal point. Please let me know how to achieve this.
Could you please review the sample attached to this post and see if it meets your requirements.
Please feel free to let me know if I misunderstood you or if you have any other questions.