In this post I am going to show you a few different ways how you can format a decimal number (float, double, or decimal). Setting the Maximum Allowed Decimal Places To format your numbers to a maximum of two decimal places use the format string {0:0.##} as shown in the below example: string.Format(“{0:0.##}”, 256.583); // [...]
{ 0 comments }
My name is David Azzopardi and I'm a software developer by profession. I have been working in the software industry for around eight years now and I have learned a few things through my experiences.