I'm developing a wpf application with componentart I have a textblock like this
<TextBlock FontSize="28" Text="{Binding DataPoint.Y, StringFormat=\{0:#\\%\}}" Foreground="Black">
As you can see, my StringFormat puts a '%' sign after the number, but if my data is 0.0 (I fill the component in code behind, my variable is a double) I get "%", but I want to get "0%", how can I do this?
you can use different
StringFormat
. Instead of0:#
put0:0
:quoting MSDN: