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

RadMaskedNumericInput: After decimal point reseting to '0' for Mask=#30.2

1 Answer 33 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 03 Mar 2014, 09:06 AM
Hi Guys,

I am using Telerik Q3 dlls 2013.3.1316.1050 for Silverlight.
I am using RadMaskedNumericInput with Mask=#30.2 as per requirements.
If I put Mask=#12.2the entire Text is displayed but for Mask=#30.2 the digits after decimal point are reseting to β€˜0’,even If I edit it after the text box looses focus it is again reseting to’0’. Ideally it should display the changed text.
Please find my piece of code:
<telerik:RadMaskedNumericInput
                                x:Name="txtA"                                                    
                                VerticalAlignment="Center" 
                                Width="120"
                                IsClearButtonVisible="False"
                                Placeholder=" "
                                Mask="#30.2"
                                ValueChanged="txtA_ValueChanged"
                                SelectionOnFocus="CaretToEnd"
                                AutoFillZeros="False"
                                HorizontalAlignment="Center"
                                FlowDirection="LeftToRight"
                                InputBehavior="Insert"
                                UpdateValueEvent="LostFocus"
                                IsLastPositionEditable="True"
                                TextMode="PlainText"
                                TextOptions.TextFormattingMode="Ideal"
                                InputMethod.IsInputMethodEnabled="True"
                                Value ="{Binding Amount, Mode=TwoWay, StringFormat=\{0:n2\}}"
                                />

Thanks,
Ravi

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 05 Mar 2014, 02:17 PM
Hello Ravi,

RadMaskedNumericInput's Value is of type double? and double in C# (.Net) has precision of 15-16 digits.
Every kind parsing might return wrong results when you type a double bigger than 15 digits.
If you really need a Mask= "30.2" we highly encourage you to use RadMaskedCurrenyInput whose value is of type decimal? and it can be used for numbers in such big range.

Regards,
Petar Mladenov
Telerik

DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Ravi
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or