I'm looking for a consistent way to structure my use of formatting strings throughout a large web application, and I'm looking for recommendations or best practices on which way to go.
Up until now I've had a static class that does some common formatting e.g.
Formatting.FormatCurrency
Formatting.FormatBookingReference
I'm not convinced that this is the way to go though, I'd prefer to use the standard way of formatting strings within .NET directly and use:
amount.ToString("c")
reference.ToString("000000")
Id use IFormattable and ICustomFormatter for some of our more complicated data structures, but I'm struggling what to do about the more simple existing objects that we need to format (in this case Int32 but also DateTime).
Do I simply define constants for "c" and "000000" and use them consistently around the whole web app or is there a more standard way to do it?