ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to round down a float number in ASP?

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
dino



Joined: 21 Nov 2004
Posts: 3

PostPosted: Mon Dec 06, 2004 5:10 pm    Post subject: How to round down a float number in ASP? Reply with quote

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
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Mon Dec 06, 2004 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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

SQL Tutorial