Formatting is Specified but argument is not IFormattable

Posted by coffeeaddict on Stack Overflow See other posts from Stack Overflow or by coffeeaddict
Published on 2010-05-17T14:09:10Z Indexed on 2010/05/17 14:10 UTC
Read the original article Hit count: 380

Filed under:

string listOfItemPrices = items.ToSemiColonList(item => string.Format("{0:C}", item.Price.ToString()));

I am simply trying to format the price here to 2 decimal places. Ok, so the string.Format doesn't implement IFormattable? Ok not sure how to get around this so that I can format the decimal (price) here.

© Stack Overflow or respective owner

Related posts about c#