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

DecimalSeparator

8 Answers 279 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Sergey
Top achievements
Rank 1
Sergey asked on 26 Sep 2013, 07:40 AM
Hello!

I have problems with RadMaskedCurrencyInput.
My culture is "ru-RU" and CurrencyDecimalSeparator is ','.

<telerik:RadMaskedCurrencyInput Value="12345" Placeholder=" " IsCurrencySymbolVisible="False">

The result is: 123 45.,00.

Control version is 2013.2.724.40.

I want to use '.' as decimal separator in spite of current culture and user settings. 
How can I do it?

Thanks is advance!

8 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 30 Sep 2013, 03:02 PM
Hi Sergey,

Let me get straight to your question.

Please note that the RadMaskedInput controls rely on the current culture of your system. This is why you are not allowed to use custom decimal separators - separators different from the default for the selected culture.

I hope this clarifies your question.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sergey
Top achievements
Rank 1
answered on 02 Oct 2013, 07:57 AM
Thanks. But I have next problem. When I set "." as decimal separator in Windows properties I can see error in RadMaskedInput. I see number like "1 23.,00". How can I fix it?
0
Sergey
Top achievements
Rank 1
answered on 02 Oct 2013, 09:12 AM
When Numberic separator and money separator in Windows properties are different, the maskedCurrency control show 2 separators ",.".
0
Sergey
Top achievements
Rank 1
answered on 03 Oct 2013, 07:15 AM
And other problem. When I set from code CurrencyGroupSeparator as single space, the RadMaskedCurrencyInput show number as 9876,34" (without group separator). How can I fix it ?
0
Petar Mladenov
Telerik team
answered on 07 Oct 2013, 06:36 AM
Hi Sergey,

 We managed to reproduce part of these issues both with WIndows Settings and Culture Settings under code. For example this code:

CultureInfo culture = new CultureInfo("en-US", false);
           NumberFormatInfo numberformat = culture.NumberFormat;
           numberformat.CurrencyDecimalSeparator = ",";
           this.maskedInput.Culture = culture;
produces the sequence ".,". Actually when we set CurrencyDecimalSeparator  and CurrencyGroupSeparator to different  symbols there is no issue, but if they are both set to one symbol "," or "." the issue occurs. Which is exactly the opposite from your observations. We are also unable  to reproduce the group separator set to " ". That is why we want to ask you for more details about your current culture, your current windows region and language settings (currency settings), and the exact code (XAML  + C#) that you use. This will help us better describe and fix our bug. Actually it is already logged in our PITS and we also updated your telerik account points as a thanks for your cooperation. We will try to have it fixed for the Q3 2013 SP in November.Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sergey
Top achievements
Rank 1
answered on 10 Oct 2013, 06:43 PM
Hello. You don't understand me. I set "." to CurrencyDecimalSeparator and "," to NumberDecimalSeparator (not to CurrencyGroupSeparator  as you wrote).
var culture = new CultureInfo("ru-RU", false)
            {
                NumberFormat =
                {
                    CurrencyDecimalSeparator = ".",
                    NumberDecimalSeparator = ",",
                    CurrencyGroupSeparator = " "
                }
            };
            Thread.CurrentThread.CurrentCulture = culture;
            Thread.CurrentThread.CurrentUICulture = culture;


This code show how can you reproduce all problems.
<Style x:Key="RadMaskedCurrencyInputStandardStyle" TargetType="{x:Type telerik:RadMaskedCurrencyInput}">
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="Placeholder" Value=" " />
            <Setter Property="IsClearButtonVisible" Value="False" />
            <Setter Property="TextMode" Value="PlainText" />
            <Setter Property="Mask" Value="#10.2" />
            <Setter Property="SelectionOnFocus" Value="SelectAll"/>
            <Setter Property="IsCurrencySymbolVisible" Value="False"/>
        </Style>
 
<telerik:RadMaskedCurrencyInput Grid.Row="1" Value="{Binding Path=SelectedOpenBookItem.Price, Mode=OneWay}"
                                    IsReadOnly="True"
                                    HorizontalAlignment="Stretch"
                                    Style="{StaticResource RadMaskedCurrencyInputStandardStyle}"
                                    />
 Problem with empty space as CurrencyGroupSeparator appears when RadMaskedCurrencyInput is not focused and Placeholder set to single space too. Thanks.
0
Petar Mladenov
Telerik team
answered on 15 Oct 2013, 12:54 PM
Hello Sergey,

 We reproduced this issue with the given code. We also added your scenario in the description of the bug that we previously logged. We will not consider this bug resolved until your scenario is solved too.

Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Sergey
Top achievements
Rank 1
answered on 20 Oct 2013, 04:08 PM
Big thanks.
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Sergey
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Sergey
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or