I am converting a MVC 5 ecommerce project to consume WEB API services instead so as to develop a mobile app for it too. I need advice on how best to handle the prices of products. In the current mvc app, the DisplayFormat attribute is working very fine.
[DisplayFormat(DataFormatString = "{0:C}", ApplyFormatInEditMode = false, NullDisplayText = "-")]
public decimal Price { get; set; }
The above displays the currency as expected (e.g. $200.29) but this does not seem to work in web api. It returns just the price digit in decimal. All the business logic now lives in the api. NOW MY QUESTION: Is there a way to send this currency in its formatted type (i.e. displays as currency, e.g. $200.29) from the api directly so I don't have to handle formatting in all the clients that'll use the api such as mobile and web? Or I have to handle the formatting in all the clients?