Solved

asp classic round down number

Posted on 2009-03-31
4
1,331 Views
Last Modified: 2012-05-06
How do i round down a number isASP classic

ie 1.7 becomes 1

thanks

dave
0
Comment
Question by:david_88
  • 2
4 Comments
 
LVL 4

Expert Comment

by:amazingwolf1
ID: 24029646
Hi:
-----------------------------
Example 1
dim x
x=24.13278
document.write(Round(x))

Output:24

-----------------------------
Example 2
dim x
x=24.13278
document.write(Round(x,2))

Output:24.13
-----------------------------
HTH
0
 
LVL 23

Accepted Solution

by:
apresto earned 500 total points
ID: 24029699

But if this is 24.57 it will round to 25. If you want this then amazingwolf1 has it bang on. If you want to round down no matter what the decimal. You could just take the number before the decimal, problem solved.

dim var
var = 12.56
Response.write Left(cstr(var), InStr(cstr(var), ".")-1)

Open in new window

0
 

Author Closing Comment

by:david_88
ID: 31564855
this is the solution i was look for (round down always) thanks worked perfectly
0
 
LVL 23

Expert Comment

by:apresto
ID: 24030445
No problem, happy to help :)
Apresto
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Scheduled IIS .Net2 AppPools recycle and SQL connection Hangs 33 129
Error viewing ASP page 12 174
Classic ASP application Will support SQL 2014 5 94
Designing forms 3 19
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question