If I have a decimal
, how do I get a string version of it with two decimal places? This isn't working:
Math.Round(myDecimal, 2).ToString("{0.00}");
Don't use the curly brackets, they are for embedding a formatted value in a longer string using string.Format
. Use this:
myDecimal.ToString("0.00");
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