Formatting a float to 2 decimal places

I am currently building a sales module for a clients website. So far I have got the sale price to calculate perfectly but where I have come stuck is formatting the output to 2 decimal places.

I am currently calling this in a variable so that I can data bind the results to a listview.

Sale = float.Parse(((x.Sale_Price - (x.Sale_Price * (x.Discount_Price / 100))).ToString())),

Can anyone show me how to format the output to 2 decimal places?? Many Thanks!

8 Answers
8

Leave a Comment