I\'m looking for a DataFormatString that will display a float as a currency. But omit the decimal values if they\'re irrelevant (0\'s).
At the moment I\'m using:
var price = 100.0M; var curr = price % 1 == 0 ? price.ToString("C0") : price.ToString("C");
You can put this in an extension method and call it where you need it.