How could I make wpf UI control like TextBlock display double value in numberic format, for example:
-If double value is 12345, make it display 12.3K or 12,3K.
-If double value is 123, make it display 0,12K or 0.12K.
I had tried StringFormat={}{0:#,}K}, this didnot support 2 digitals behind decimal point.
WPF TextBlock double value format.
Binding="{Binding Volume, StringFormat={}{0:#,}K}"
expect:
-12.3K for 12345;
-0.12K for 123;
ps:I had tried IValueConverter solution.My data is displayed in a datagrid control.By using IValueConverter. I will got "12.3K" not correct data "12345" after copy that to a clipboard.
I think I need a string format way.