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

Hiding ","

8 Answers 165 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Alex Wu
Top achievements
Rank 1
Alex Wu asked on 28 Jan 2010, 06:56 PM
I want to hide the "," comma character in value. For example, instead of displaying "2,010" I want to display "2010"

8 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 01 Feb 2010, 09:49 AM
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.
0
Terry
Top achievements
Rank 1
answered on 27 Jul 2010, 05:04 AM
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


0
Konstantina
Telerik team
answered on 28 Jul 2010, 03:25 PM
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
0
Erik
Top achievements
Rank 2
answered on 18 Mar 2011, 04:53 PM
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)

0
George
Telerik team
answered on 18 Mar 2011, 05:36 PM
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
0
Erik
Top achievements
Rank 2
answered on 18 Mar 2011, 09:07 PM
stoobad... :-)
0
Erik
Top achievements
Rank 2
answered on 02 Sep 2011, 05:11 PM
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

0
Ivo
Telerik team
answered on 06 Sep 2011, 07:46 AM
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 >>

Tags
NumericUpDown
Asked by
Alex Wu
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Terry
Top achievements
Rank 1
Erik
Top achievements
Rank 2
George
Telerik team
Ivo
Telerik team
Share this question
or