Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

asp classic round down number

Posted on 2009-03-31
4
Medium Priority
?
1,398 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

650 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