code_junkie

Best way to convert a decimal value to a currency string for display in HTML

Nov 10th, 2011
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <span class="ourprice">
  2. <%=GetPrice().ToString("C")%>
  3. </span>
  4.  
  5. <span class="ourprice">
  6. <%=GetPrice().ToString("C").Replace("£","&pound;")%>
  7. </span>
  8.  
  9. <globalization culture="auto:en-us" uiCulture="auto:en-US" />
  10.  
  11. <globalization culture="us" uiCulture="en-gb" />
  12.  
  13. <%@Page Culture="en-gb" UICulture="en-gb" ..etc... %>
  14.  
  15. <%=String.Format("{0:C}",GetPrice())%>
  16.  
  17. GetPrice().ToString("C", CultureInfo.CreateSpecificCulture("en-GB"))
Add Comment
Please, Sign In to add comment