Can I Format numbers with VBScript as in MS Access?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rmurgia
    New Member
    • May 2008
    • 63

    Can I Format numbers with VBScript as in MS Access?

    Is there a way to format numeric data in vbscript? In access, I could write:
    format(dbTestVa riable,"0.00%") . This does not work when I embed it on the ASP page.
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    try formatnumber(), let me know if it helps.

    Jared

    Comment

    • rmurgia
      New Member
      • May 2008
      • 63

      #3
      Originally posted by jhardman
      try formatnumber(), let me know if it helps.

      Jared
      Jared,
      It worked! Thanks for the help. Related to this issue, I was able to type:

      <%=FormatNumber (dbMthBudFTF,2) % to get the 2 digit decimal place. Is there a way to format as a percentage, like in MS Access: Format(dbMthBud FTF,"0.00%").

      Thanks again,
      Ralph

      Comment

      • jhardman
        Recognized Expert Specialist
        • Jan 2007
        • 3405

        #4
        Sorry if my original answer didn't completely answer you. try:
        Code:
        <%=FormatPercent(dbMthBudFTF,2) %>
        Originally posted by w3schools
        Function Description
        FormatCurrency Returns an expression formatted as a currency value
        FormatDateTime Returns an expression formatted as a date or time
        FormatNumber Returns an expression formatted as a number
        FormatPercent Returns an expression formatted as a percentage
        w3School's explanation . W3schools is a very good resource, worth playing around on and hanging out. Anyway, let me know if it helps.

        Jared

        Comment

        • rmurgia
          New Member
          • May 2008
          • 63

          #5
          Jared,

          It worked great. Thanks much!

          Comment

          Working...