Posts tagged as:

Decimal

Formatting Decimals in C#

by Dave on September 23, 2009

in String Operations

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 }