Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

divide function

Status
Not open for further replies.

QTip

Programmer
Mar 7, 2001
66
BE
Hi,

I need the function to divide 2 numbers and retrieve the 'rest' value.
an example:
24 / 6 = 4 -> so the 'rest' value is 0
24 / 5 = 4.8 -> so the 'rest' value is 0,8

Is there a function in vbscript that retrieves automatically the 'rest' value?

thnx!
 
Hi,

There is no such function in VBScript.
We have to write our own function.
Here is a sample.

<%
Function rest(xValue,xDivisor)
Dim modvalue
modvalue = xValue mod xDivisor
rest = modvalue % xDivisor
End Function
%>

Regards,
balajees
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top