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

Numeric Indicator formatting

2 Answers 88 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 19 Jun 2012, 02:46 PM
Hi..
I'm trying to format the numeric indicator with commas.  I have very large values.
When I apply the format...

I get results like this

,133,445,666,666

Notice the leading comma, how can  correct the formatting?
Do I need ALL the positions?
thanks in advance





  <telerik:NumericIndicator Name="numericELEC"  Foreground="Blue" FontSize="14" Margin="0,60,0,0" 
                                                        Format="{}{0:#,###0}"
                                                        telerik:ScaleObject.RelativeX=".1"
                                                        telerik:ScaleObject.RelativeY=".5"
                                                        telerik:ScaleObject.RelativeWidth="1.5"
                                                        telerik:ScaleObject.RelativeHeight=".3"
                                                        Value="1111111153">


                                                      <telerik:NumericIndicator.Background>
                                                        <SolidColorBrush Color="Transparent"/>
                                                    </telerik:NumericIndicator.Background>


                                                    <telerik:NumericIndicator.Positions>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                        <telerik:FontNumberPosition/>
                                                    </telerik:NumericIndicator.Positions>
                                                </telerik:NumericIndicator>

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 22 Jun 2012, 07:56 AM
Hello Jon,

Your format string is OK. You simply don't have enough positions to show the whole value. If you would change the value of the numeric indicator to "1234567890" (same 10 digits as it is in your code, but this value is better to see which digits are missed) then you will see that leading "1" isn't shown. It is because you have the number of positions less then it is necessary to show whole value. Simple add positions to show whole value.

All the best,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jon
Top achievements
Rank 1
answered on 22 Jun 2012, 11:02 AM
thanks!
Tags
Gauge
Asked by
Jon
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Jon
Top achievements
Rank 1
Share this question
or