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:
I don't think there is a way to do it that explicitly uses currency formatting, but you can use custom formatting using the #
character: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx
This should work for U.S. currency:
[DisplayFormat(DataFormatString = "{0:$#.##}")]
The #
character only represents a digit if it's needed.