I have an asp.net mvc application and I have a page for presenting meteo information. It looks like:
Temperature for today is 34-35 degrees
For this
34-35 degrees
, I have a method that assure that the text will be in format
[Number][Dot][Number]
called AssureCorrectDegressFormat(). Now I am asking where is it suited the best. Untill now I was calling it from the view, smth like this:
<%=SafeData.AssureCorrectDegressFormat(DV.TheDegreeString)%>
But as I think the view is intended only to display data , not to call some methods in order to operate with thise literals. I moved my class SafeData to the Core of my application, and I pass to the view the DTO that has already called this method and obtained the right data for displaying. I am interested in your opinions about this, where is the best place to put this class, maybe in Infrastructure layer and where to call it, now I call itr from my services . I forgot to say that I am using a DDD aproach.