How can I round a number in VBScript / ASP ?

Results 1 to 4 of 4

Thread: How can I round a number in VBScript / ASP ?

  1. #1
    Join Date
    Dec 1969
    Posts
    1,388

    Default How can I round a number in VBScript / ASP ?

    Let&#039s say I get a result of 5.048 in a calculation function I have written. How can I get the result of this number to be rounded to 5.05? Is this possible? If anyone has any idea I would greatly appreciate the help...

  2. #2
    Join Date
    Dec 1969
    Posts
    915

    Default RE: How can I round a number in VBScript / ASP ?

    I hope this helps...<BR><BR>Dim intNumber<BR><BR>intNumber = 5.048<BR><BR>response.write (FormatNumber(intNumber, 2)) & "<BR>"<BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    915

    Default RE: How can I round a number in VBScript / ASP ?

    Oops! I forgot to remove the Line Break.<BR><BR>Dim intNumber<BR><BR>intNumber = 5.048<BR><BR>response.write (FormatNumber(intNumber, 2))

  4. #4
    dclark Guest

    Default RE: How can I round a number in VBScript / ASP ?

    There&#039s also a round function in vbscript.


Posting Permissions

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