In an MVC application with ASPNET CORE 2, I want to centralize in some way how the Decimal or Double values are formatted.
Right now I use
@string.Format("{0:N2}", valor)
But I would like not to have to use in all the sites that I have to format the value because if for some reason I wanted to change the format I would have to change it in many places. I wish I could use something like
@Utils.FormatDecimal(value)
But I can not find the most correct way to do it.