Solved

asp classic round down number

Posted on 2009-03-31
4
1,312 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

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 …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

810 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