Reputation: 2149
I am reading data from an Excel sheet as test data,
But when I read the two cells, I got 17.5 and 52.5 respectively.
Anyone has a solution?
Upvotes: 1
Views: 107
Reputation: 482
If all your needing to do is display 17.5, as 17.50 and are always expecting 2 decimal places, you can do the following:
excelValue.ToString("#.00", CultureInfo.InvariantCulture);
Upvotes: 2