I am working on a system that generates emails from a template. Templates have been supplied by the business, and they contain a line of code similar to this one:
Thank you for your payment of @((decimal.Parse(Model.PaymentAmount)/100).ToString("C"))
In this case the PaymentAmount is expected as a string representation of an integer (eg the required output £5.54 would be provided as "554").
Now, I am of the opinion that there should be no calculations in the presentation layer - in this case there is the /100 calculation, and a parse. I have suggested a number of alternatives for this, where a transformation is carried out in code before the template to give an altered view such as:
Thank you for your payment of @Model.PaymentAmount.ToString("C")
We have a set of reasonably competent, technical architects on the project but I am having trouble convincing them of a good reason for this.
Can anyone help me with an argument to present to the architects that would work in getting the latter fragment of code implemented over the former - or if you disagree with this approach, why?