Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. namespace UnpremierBetting.Utilities
  2. {
  3. using System;
  4. using System.Globalization;
  5. using System.Web.Mvc;
  6.  
  7. public static class HtmlExtensions
  8. {
  9. public static MvcHtmlString DisplayPrice(this HtmlHelper helper, decimal price)
  10. {
  11. var format = new NumberFormatInfo() {NumberGroupSeparator = " "};
  12. string formatedPrice = price.ToString("N0", format);
  13.  
  14. return new MvcHtmlString($"£{formatedPrice}");
  15. }
  16.  
  17. public static MvcHtmlString MatchDate(this HtmlHelper helper, DateTime matchDate, string tag)
  18. {
  19. var h3 = new TagBuilder(tag);
  20. string matchDay = matchDate.ToString("D");
  21. h3.InnerHtml = matchDay;
  22.  
  23. return new MvcHtmlString(h3.ToString());
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement