I found something like this:
How to set WPF string format as percent wihout multiplying by 100?
I just want to have a ‘%’ sign suffix after my number. my code looks like this
<Label Content="{Binding Path=ReportGridViewModel.FillingDegree, StringFormat=P}" />
I already tried this one too
<Label Content="{Binding ReportGridViewModel.Cgi, StringFormat={}{0}%}" />
in both cases I don’t see any changes like I don’t have any stringformat.
The
StringFormatproperty of aBindingis only applied when the target property is of typeString. In aLabel, the target propertyContent, is of typeObject, soStringFormatis not respected.To get this to work in a label, use
ContentStringFormat. If you were to use aTextBlock, you could use theStringFormatprovided byBinding.