Formatting of numbers

Results 1 to 2 of 2

Thread: Formatting of numbers

  1. #1
    Chris Clarke Guest

    Default Formatting of numbers

    I am trying to format currency using ASP/VBScript. Although for "float" numbers with many decimal places I can use the round number to truncate the numbers to 2 decimal places, this does not work using whole numbers. Is there any way to force two decimal places, (using a function, maybe??) <BR><BR>Also I would like to use commas to denote 000&#039s, e.g £1,000,000. Is there any easy way to do this??<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Formatting of numbers

    You can use the FormatCurrency Function e.g.<BR><BR>dim price,fmtprice<BR>fmtprice = FormatCurrency("10000")<BR>response.write("price is " & fmtprice)<BR><BR>this produces the following<BR><BR>price is $10,000.00<BR><BR>NOTE: This returns an expression formatted as a currency value using the currency symbol defined in the system control panel (Regional Settings-&#062;Currency). The comma settings are also specified in this section.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts