I’m using The following format string in a WPF binding:
StringFormat={}{0:Gain: 0 dB}
And when the bound value goes negative I get:
-Gain: 1234 dB
My desired output is “Gain: -1234 dB”. Can someone tell me what I’m doing wrong, and maybe a couple rules of thumb for using these format strings?
Try this:
You can also try it without the apostrophes, if it doesn’t work with them in your case.
For more complex cases, you can also consider implementing
IValueConverterclass to use in the binding.