I'd like to format my number as a percent value with an always visible sign.
To format it as a percent value I can do:
string.Format("{0:P2}", 1.45);
For visible signs I'll do:
string.Format("{0:+#.##;-#.##;0}", 1.45);
Any way to combine the two?
You probably just want to add % to custom format:
string.Format("{0:+#.##%;-#.##%;0}", 1.45); // output +145%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With