If I enter a value into a XamNumericEditor that has a mask of {double:4.2}, and I only enter the first four digits and I tab off it, why doesn't the control fill in the decimal places with 0's?
I just leaves and empty place... Any way to fix that?
You can change the DisplayMode to IncludeBoth so it includes the PromtChar after exiting edit mode e.g.
<ig:XamNumericEditor x:Name="xamNumericEditor1" Width="200" Height="30" ValueType="System:Double" Mask="{}{double:4.2}" PromptChar="0" DisplayMode="IncludeBoth" />
Hope that helps!
Hi, I'm unable to use the above tip, my xamnumericinput removes the 0s as they are promptchars, so entering '200' gives me 2.
In my case, I just want to have a 3-digit number that fills with 0 no matter what the user adds, so adding '45' displays '045' and adding '202' displays '202', and I want to be able to save the values correctly to 45 and 202 respectively. I've experimented with promptchars and masks of '###', '999' and 'nnn' but they all don't work.
Is there a cleaner way ?
With this workaround, if the user types "12.3" it will display "0012.30" when in fact, we need to display "12.30".
In my case, I use the XamNumericEditor to display currency and percentages, so the decimal numbers are really important (12.30$ versus 12.3$ or 0012.30$)
Any other solution ?
Thank you,
Yes but then if the user types "12.3" it will display "0012.30" which is not really pretty neither :(