Replace thousands separator

6 posts, 0 answers
  1. Jiri
    Jiri avatar
    23 posts
    Member since:
    Aug 2013

    Posted 05 Jun 2014 Link to this post

    Hi,

    I am usin RadNumericUpDown for editing of year, but i have problem with thousands separator. my problem is, that year is displayed as 2 014 (with whitespace), but I need 2014. Is there any way how to achieve that?

    Thank you.
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 06 Jun 2014 Link to this post

    Hello Jiri,

    In order to remove the white space, you will have to set the NumberGroupSeparator property of the NumberFormatInfo to an empty string, for example:

    <telerik:RadNumericUpDown x:Name="RadNumericUpDown" IsInteger="True">
       <telerik:RadNumericUpDown.NumberFormatInfo>
         <culture:NumberFormatInfo
                    NumberGroupSeparator="" />
       </telerik:RadNumericUpDown.NumberFormatInfo>
    </telerik:RadNumericUpDown>

    Hope this helps.


    Regards,
    Konstantina
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. AF
    AF avatar
    1 posts
    Member since:
    Apr 2014

    Posted 17 Jul 2014 in reply to Konstantina Link to this post

    Hi Konstantina,

    On your solution,


    <telerik:RadNumericUpDown x:Name="RadNumericUpDown" IsInteger="True">
       <telerik:RadNumericUpDown.NumberFormatInfo>
         <culture:NumberFormatInfo
                    NumberGroupSeparator="" />
       </telerik:RadNumericUpDown.NumberFormatInfo>
    </telerik:RadNumericUpDown>


    how did you define the 'culture' prefix? It would be very usefull if you could explain it, this is the best workaround I could find so far but this doesn't work if i don't define the prefix first.

    Thanks.
  4. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 18 Jul 2014 Link to this post

    Hello,

    The NumericUpDown control takes all the formatting information it needs from the culture setting of your machine or application, if they are set explicitly. If the used culture has the same setting, then it won't be needed the NumberGroupSeparator property to be set.

    Does this clarify the matter?

    Regards,
    Konstantina
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  5. Heiko
    Heiko avatar
    20 posts
    Member since:
    Nov 2013

    Posted 02 Jul 2018 in reply to AF Link to this post

    I know this post is quite old but since Konstantina did not answer what namespace culture is; for future reference:

            xmlns:culture="clr-namespace:System.Globalization;assembly=mscorlib"

  6. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2191 posts

    Posted 03 Jul 2018 Link to this post

    Hello Heiko,

    Thank you for sharing the namespace.

    Regards,
    Martin Ivanov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top