format numbers in html

How do I insert the Grouping Separator in my HTML code for the body of an Outlook message so that there is a comma, "," every three digits, like in 1,234,567

The following code produces a table where the numbers are not formatted as required:

.HTMLBody = "<HTML><BODY><B>" & side & Sheet2.Cells(14, 14) & "</b><br></br> " & _
"<UL><TABLE border='1' width='230'><TR><TD width='140'>" & _
Sheet2.Cells(11, 13) & "</TD><TD align='right'>" & Sheet2.Cells(11, 14) & _
"</TD></TR><TR><TD>" & Sheet2.Cells(12, 13) & "</TD><TD align='right'>" & Sheet2.Cells(12, 14) & _
"</TD></TR><TR><TD></TD><TD align='right'><B>" & Sheet2.Cells(13, 14) & "</B></TD></TR></TABLE></UL>" & _
"<br><b> Antonio <br>Company</b></br></BODY></HTML>"



Answer this question

format numbers in html

  • Simon Tindall

    .HTMLBody = "<HTML><BODY><B>" & side & Sheet2.Cells(14, 14) & "</b><br></br> " & _
    "<UL><TABLE border='1' width='230'><TR><TD width='140'>" & _
    Sheet2.Cells(11, 13) & "</TD><TD align='right'>" & FormatNumber(Sheet2.Cells(11, 14), 0) & _
    "</TD></TR><TR><TD>" & Sheet2.Cells(12, 13) & "</TD><TD align='right'>" & FormatNumber(Sheet2.Cells(12, 14), 0) & _
    "</TD></TR><TR><TD></TD><TD align='right'><B>" & FormatNumber(Sheet2.Cells(13, 14), 0) & "</B></TD></TR></TABLE></UL>" & _
    "<br><b> Antonio <br>Company</b></br></BODY></HTML>"

  • format numbers in html