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:
[DisplayFormat(DataFormatString = "{0:C}")]
On my models. This is displaying as a currency correctly. I've not been able to find anywhere that details what changes I need to make to omit the decimal places?
See Question&Answers more detail:os