value is like $5,000,000,000.00 i want to show this value as 5 billion or $6,000,000,000.00 as 6 billion like this can any one help me....

2 posts, 0 answers
  1. Srikanth
    Srikanth avatar
    14 posts
    Member since:
    Mar 2012

    Posted 22 Jul 2015 Link to this post

    value is like $5,000,000,000.00 i want to show this value as 5 billion or $6,000,000,000.00 as 6 billion like this can any one help me....

     

    like 1k,100k,200k............

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 27 Jul 2015 Link to this post

    Hello,

    You can use templates in the gauge labels, the similar way like with the chart's labels - http://www.telerik.com/forums/showing-value-%28in-thousands%29. For example:

    ASPX:
    <script>
        function FormatLongNumber(value) {
     
            if (value === 0) {
                return 0;
            }
     
            // hundreds
            if (value <= 999) {
                return value;
            }
     
            // thousands
            if (value >= 1000 && value <= 999999) {
                return (value / 1000) + 'K';
            }
     
            // millions
            if (value >= 1000000 && value <= 999999999) {
                return (value / 1000000) + 'M';
            }
     
            // billions
            if (value >= 1000000000 && value <= 999999999999) {
                return (value / 1000000000) + 'B';
            }
     
            return value;
        }
    </script>
    <telerik:RadRadialGauge runat="server" ID="RadRadialGauge1" Height="350px" Width="350px">
        <Pointer Value="1000000000" Color="Black">
            <Cap Color="Gray" Size="0.1" />
        </Pointer>
        <Scale Min="0" Max="4000000">
            <Labels Position="Outside" Template="#=FormatLongNumber(value)#" />
            <Ranges>
                <telerik:GaugeRange Color="Orange" From="1000000" To="2000000" />
                <telerik:GaugeRange Color="Green" From="2000000" To="3000000" />
                <telerik:GaugeRange Color="Red" From="3000000" To="4000000" />
            </Ranges>
        </Scale>
    </telerik:RadRadialGauge>



    Regards,
    Danail Vasilev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top