How to control decimal places

Results 1 to 3 of 3

Thread: How to control decimal places

  1. #1
    Hunter Powers Guest

    Default How to control decimal places

    How do you controll decimal places when writing a variable to the screen. My problem happens when I am totaling a bill and it goes 5 places past a decimal place, but I obviously need it to only go 2.

  2. #2
    Stephan Zutterman Guest

    Default RE: How to control decimal places

    You can use the Round function ...<BR><BR>Description: Returns a number rounded to a specified number of decimal places.<BR>Syntax: Round(expression[, numdecimalplaces])<BR><BR>The following example uses the Round function to round a number to two decimal places: <BR><BR>&#060;%<BR><BR>Dim MyVar, pi<BR>pi = 3.14159<BR>MyVar = Round(pi, 2) &#039MyVar contains 3.14.<BR><BR>%&#062;

  3. #3
    Jairo Guest

    Default RE: How to control decimal places

    Hunter,<BR>In VBScript, you can try using the FormatCurrency function.<BR><BR>HTH,<BR>Jairo

Posting Permissions

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