473,480 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

math.round

I am not sure I am doing this right but I do get a result. How can I round
the value to the nearest whole number. I have searched on math.round but
can not get it to function. Here is how I am getting the results if not
division by zero.
<%results =
rsCir("PetA")+rsCir("PetB")+rsCir("PetC")+rsCir("P etD")/rsCir("Abandons")%>
How can I get only the whole number from this division?
Thanks

Jeff

Jul 19 '05 #1
2 3568
Got it. Did it with a formatpercent.

Thanks
Jeff
"Jeff Uchtman" <uc*****@megavision.com> wrote in message
news:uf****************@TK2MSFTNGP09.phx.gbl...
I am not sure I am doing this right but I do get a result. How can I round the value to the nearest whole number. I have searched on math.round but
can not get it to function. Here is how I am getting the results if not
division by zero.
<%results =
rsCir("PetA")+rsCir("PetB")+rsCir("PetC")+rsCir("P etD")/rsCir("Abandons")%> How can I get only the whole number from this division?
Thanks

Jeff

Jul 19 '05 #2
Jeff Uchtman wrote on 17 feb 2004 in
microsoft.public.inetserver.asp.general:
"Jeff Uchtman" <uc*****@megavision.com> wrote in message
I am not sure I am doing this right but I do get a result. How can I
und the value to the nearest whole number.
Got it. Did it with a formatpercent.


Math.round is javascript.

For vbscript, better use:

result = Round(expression)
[the format functions return a string]
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3933
by: Nicolas | last post by:
Why does for the same code I got different result the VB code gave me what I want why not the csharp? Thank you for your help... CSHARP CODE int sx, sy; double sdegrees; sdegrees = (90 -...
6
7085
by: ng_mr | last post by:
No, not a question about "banker's rounding" or whatever it's called. I want to round a double to the nearest 100th, so I perform the following: // original is a double double result =...
1
3428
by: nvphu | last post by:
I need to use the constant M_PI. So, I insert the directive # include <math.h>. However when compiled, there are errors : M_PI undeclared identifier. Second, I can not use the function...
6
9525
by: Mitchell Vincent | last post by:
Just making sure I'm not missing the boat here, but are there any special routines for doing currency math (fixed precision stuff) in .NET? The wonderful problems of doing math on decimals tend...
4
3423
by: Chris Davoli | last post by:
The folllowing will round to 526, but it should round to 527. It works correctly for all other numbers, except for this one. Does anybody know of a bug in Math.Round? Dim ldecWater As Decimal =...
10
15951
by: David Coleman | last post by:
I am running VS 2003 and have applied SP1. (On WinXP SP2, .Net 1.1) In the Command Window I get the following ? Math.Round(0.715, 2) 0.72 ? Math.Round(0.725, 2) 0.72 ? Math.Round(0.735, 2)...
3
5311
by: Altman | last post by:
OK I was having rounding problems before and I didn't realize that their was a third parameter in the round function that would tell it if it a 5 to round up. I thought adding this would fix the...
6
9094
by: Zeng | last post by:
Math.Round has good behavior as following: Math.Round(3.45, 1); //Returns 3.4. The last '5' is thrown away because 4 is even Math.Round(3.75, 1); //Returns 3.8. The last '5' is used because '7'...
4
10864
by: =?Utf-8?B?UmVuZQ==?= | last post by:
Hello everyone I have a problem with Math.Round, it´s ocurring some strange: Math.Round(12.985) = 12.98, it´s wrong. It should be: 12.99 Why?? What is the problem? Help ME !!!!
9
5578
by: DaiOz | last post by:
Hi guys im doing a course which includes some JavaScript and I need help with the following question please, The code I have so far is below but I don't think its right please help as I need...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6732
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2990
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.