View previous topic :: View next topic |
Author |
Message |
dino
Joined: 21 Nov 2004 Posts: 3
|
Posted: Mon Dec 06, 2004 5:10 pm Post subject: How to round down a float number in ASP? |
|
|
I have an ASP page with several calculations, resulting in floating-point numbers. I want to round down those numbers with certain precision. How do I do the round down in VBScript?
Dino |
|
Back to top |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
Posted: Mon Dec 06, 2004 5:46 pm Post subject: |
|
|
You can use the Round Vbscript function in your ASP pages.
The Round VBScript function rounds off a floating-point number to a specified number of decimal places.
The Round VBScript function has one mandatory argument, which is the number you want to round and a second argument which is the decimal precision. If the second argument is not specified, the number is rounded to an integer.
Code: |
Round(1.333333) ' this will return 1
Round(1.333333, 2) ' this will return 1.33
|
_________________ Peter
ASP & ASP.NET Articles and Tutorials |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|