I would like to display decimal
numbers as USD currency within HTML pages. For example, display 1209.27 as $1,209 27.
Instead of using [DataType(DataType.Currency)]
in the models, I format each number directly in the view:
@Html.Raw(Regex.Replace(Regex.Replace(String.Format("{0:C}", Model.Price), "(?<=\\.)([^.]*$)", "<sup> $1</sup>"), "\\.<sup>", "<sup>"))
Is there a more efficient way to achieve this format instead of repeating this all over?