Hiding ","

9 posts, 0 answers
  1. Alex Wu
    Alex Wu avatar
    31 posts
    Member since:
    Dec 2009

    Posted 28 Jan 2010 Link to this post

    I want to hide the "," comma character in value. For example, instead of displaying "2,010" I want to display "2010"
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 01 Feb 2010 Link to this post

    Hi Alex,

    Thank you for contacting us.

    If you want to remove the comma in the digit, you can use the IsInteger property of the NumericUpDown. If you set IsInteger="True" that will return the value as integer and you won't have the comma.

    If you have further questions please feel free to contact us again.

    Greetings,
    Konstantina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Terry
    Terry avatar
    157 posts
    Member since:
    Jul 2009

    Posted 27 Jul 2010 Link to this post

    This is not working for me

    the xaml:

    <telerik:RadNumericUpDown x:Name="txtNextInvoiceNo" Grid.Row="3" Grid.Column="1" IsInteger="True" />

    the c#:

    InvokeOperation<int> op = wdc.GetNextInvoiceNo( app.CompanyID );
    op.Completed += ( sender, args ) =>
    {
        if ( op.Error == null )
        {
            int result = op.Value;
            txtNextInvoiceNo.Value = Convert.ToDouble( result );
        }
    }; 

    the result:
    2,007,027

    I'm using the Q2 SL4 release.

    Thanks in advance for your help,

    Terry


  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 28 Jul 2010 Link to this post

    Hi Terry,

    Thank you for contacting us.

    This comma is not the one for the double digit, it is the string that separates groups of digits to the left of the decimal in numeric values. You can easily remove that by setting the NumberGroupSeparator property to an empty string:

    this.txtNextInvoiceNo.NumberFormatInfo.NumberGroupSeparator = "";

    If you have further questions please let us know.

    Greetings,
    Konstantina
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 18 Mar 2011 Link to this post

    Hi Konstantina,

    Your code is working fine, however, how should we do that in the XAML? I did see a blog, but that was about WPF and gave an error:

    <telerik:RadNumericUpDown Name="rnt_Port" .... >
        <telerik:RadNumericUpDown.NumberFormatInfo NumberGroupSeparator="">
            <Globalization:NumberFormatInfo NumberGroupSeparator="0" />
        </telerik:RadNumericUpDown.NumberFormatInfo>
    </telerik:RadNumericUpDown>

    but the tag <Globalization:NumberFormatInfo results in an error... can't seem to find it anywhere..

    (Tags: thousands separator, group separator)

  7. George
    Admin
    George avatar
    1332 posts

    Posted 18 Mar 2011 Link to this post

    Hi,

     
    Unfortunately, setting a number format in xaml is a limitation of Silverlight. I would suggest you to set it in the code-behind.

    Kind regards,
    George
    the Telerik team
  8. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 18 Mar 2011 Link to this post

    stoobad... :-)
  9. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 02 Sep 2011 Link to this post

    Hello Konstantina and George,

    In my new version this behaviour generates an error...

    this.txtNextInvoiceNo.NumberFormatInfo.NumberGroupSeparator = "";
    The NumberFormatInfo property is Nothing... (in vb.net)
    It has worked before but now generates an error...

    Regards,

    Erik

  10. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 06 Sep 2011 Link to this post

    Hello Erik,

    This should do the trick for you:

    this.txtNextInvoiceNo.NumberFormatInfo = new System.Globalization.NumberFormatInfo();
    this.txtNextInvoiceNo.NumberFormatInfo.NumberGroupSeparator = "";

    Hope this helps.

    Greetings,
    Ivo
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top
DevCraft banner