DecimalSeparator

9 posts, 0 answers
  1. Sergey
    Sergey avatar
    58 posts
    Member since:
    Jan 2013

    Posted 26 Sep 2013 Link to this post

    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!
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 30 Sep 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sergey
    Sergey avatar
    58 posts
    Member since:
    Jan 2013

    Posted 02 Oct 2013 Link to this post

    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?
  5. Sergey
    Sergey avatar
    58 posts
    Member since:
    Jan 2013

    Posted 02 Oct 2013 Link to this post

    When Numberic separator and money separator in Windows properties are different, the maskedCurrency control show 2 separators ",.".
  6. Sergey
    Sergey avatar
    58 posts
    Member since:
    Jan 2013

    Posted 03 Oct 2013 Link to this post

    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 ?
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 07 Oct 2013 Link to this post

    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 >>
  8. Sergey
    Sergey avatar
    58 posts
    Member since:
    Jan 2013

    Posted 10 Oct 2013 Link to this post

    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.
  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 15 Oct 2013 Link to this post

    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 >>
  10. Sergey
    Sergey avatar
    58 posts
    Member since:
    Jan 2013

    Posted 20 Oct 2013 Link to this post

    Big thanks.
Back to Top
UI for WPF is Visual Studio 2017 Ready