Format indicator value to integer

Thread is closed for posting
2 posts, 0 answers
  1. Johan
    Johan avatar
    5 posts
    Member since:
    Aug 2012

    Posted 23 Nov 2012 Link to this post

    I have created a Linear Gauge in my WP app by using the Smart Tag.
    This results in some of the xaml I pasted in below.

    The numeric indicator value below the linear gauge shows with a decimal, eg "12,0".
    How can I format it to show without decimals, eg "12" ?
    The binded value "MyIntValueInViewModel" is an int.

    <gauges:MarkerGaugeIndicator x:Name="indicator3" IsAnimated="True" gauges:LinearGaugeRange.IndicatorOffset="12"  Value="{Binding MyIntValueInViewModel}">
          <Grid Height="37" Width="37">
              <TranslateTransform X="20"/>
              <TextBlock FontWeight="Bold" FontSize="13" HorizontalAlignment="Center" Text="{Binding Converter={StaticResource valueToStringConverter}}" VerticalAlignment="Center"/>
  2. Victor
    Victor avatar
    1358 posts

    Posted 26 Nov 2012 Link to this post

    Hello Johan,

    The text block should display whatever value is returned from the valueToStringConverter. If the converter returns an int converted to string, the text block should display it as is. It is the job of the converter to apply any formatting to the resulting string.

    I hope that's helpful. Please write again if have other questions.

    Kind regards,
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top