I have a problem with a budgeting application of mine. It takes the an input, Budget, and subtracts the TotalCost from it, to give a value of Money left over. It then subtracts Budget from TotalCost to give a value of money needed. The problem I have is that I do not want either Money left over or Money needed to be a negative, instead I want them to display "0" if they are negative. Also I need them to be formatted to 2 d.p.
Thank you in advance for your help!!
Well, you could use your value object to make sure it only outputs a 0. Or you could create a class that extends NumberFormatter, override the format function and do what you want and need to there. Personally, I would use the custom formatter or a presentation model.