Link:http://output.to/sideway/default.asp?qno=180300012 Script, Scripting Language, VBScript elements, Server-Side VBScript Function Math Function Int Fix,Round Function
VBScript Math FunctionsFunctions for manipulating mathematics expression. CInt Functionlast updated 9/17/2017Create an Integer data subtype value from a given expression. SyntaxCInt(expression) ArgumentexpressionRequired. Any valid numeric expression that is used for the evaluation of the CInt result.ReturnsReturns a Variant of Integer data subtype obtained by converting the data type of a given expression to Integer data subtype.Returns of function: expressionreturn valueBoolean False0valid numeric expression.TypeName(CInt(expression))=IntegerBoolean True-1 Special returns of function: expressionreturn valueNullRun-time ErrorEmpty0""Run-time Error Remarks
Requirement1Int Functionlast updated 9/19/2017Create an integer value of a given number that is less than or equal to the given number. SyntaxInt(number) ArgumentnumberRequired. Any valid numeric expressionReturnsReturns a Variant of the same given number data subtype containing the integer value of a given number that is less than or equal to the given number.Special returns of Int function: numberreturn valueNullNullEmpty0""Run-time Error Remarks
Requirement1Fix Functionlast updated 9/19/2017Create an integer value of a given number that is equal to the integer part of the given number by removing the fractional part or non-integer part of the given number. SyntaxFix(number) ArgumentnumberRequired. Any valid numeric expressionReturnsReturns a Variant of the same given number data subtype containing the integer value of a given number that is equal to the integer part of the given number by removing the fractional part or non-integer part of the given number.Special returns of Int function: numberreturn valueNullNullEmpty0""Run-time Error Remarks
Requirement1ExamplesExamples of Int, Fix functions ASP VbScript Command:
HTML Web Page In-line Output: Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /internet/users/sideblog/default.asp varsnum, TypeNameInt(num), TypeNameFix(num), TypeNameRound(num), TypeNamenum=Null[], Null[], Null[], Null[error], errornum=Empty[], Empty[0], Integer[0], Integer[0], Integernum=""[], String[error], error[error], error[error], errornum=0[0], Integer[0], Integer[0], Integer[0], Integernum=4[4], Integer[4], Integer[4], Integer[4], Integernum=4E103[4E+103], Double[4E+103], Double[4E+103], Double[4E+103], Doublenum=4E-103[4E-103], Double[0], Double[0], Double[0], Doublenum=-4[-4], Integer[-4], Integer[-4], Integer[-4], Integernum=-4E103[-4E+103], Double[-4E+103], Double[-4E+103], Double[-4E+103], Doublenum=-4E-103[-4E-103], Double[-1], Double[-0], Double[0], Doublenum=12.142[12.142], Double[12], Double[12], Double[12], Doublenum=12.968[12.968], Double[12], Double[12], Double[13], Doublenum=-12.142[-12.142], Double[-13], Double[-12], Double[-12], Doublenum=-12.968[-12.968], Double[-13], Double[-12], Double[-13], Doublenum=11.535[11.535], Double[11], Double[11], Double[12], Doublenum=11.525[11.525], Double[11], Double[11], Double[12], Doublenum=-11.525[-11.525], Double[-12], Double[-11], Double[-12], Doublenum=-11.535[-11.535], Double[-12], Double[-11], Double[-12], Doublenum=5.555[5.555], Double[5], Double[5], Double[6], Doublenum=-5.555[-5.555], Double[-6], Double[-5], Double[-6], Doublenum=12.565[12.565], Double[12], Double[12], Double[13], Doublenum=-12.575[-12.575], Double[-13], Double[-12], Double[-13], Doublenum=13.152[13.152], Double[13], Double[13], Double[13], Doublenum=-13.152[-13.152], Double[-14], Double[-13], Double[-13], Doublenum=13.848[13.848], Double[13], Double[13], Double[14], Doublenum=-13.868[-13.868], Double[-14], Double[-13], Double[-14], Doublenum=13.555[13.555], Double[13], Double[13], Double[14], Doublenum=-13.545[-13.545], Double[-14], Double[-13], Double[-14], Double Round Functionlast updated 9/21/2017Create a numeric value of a given numeric expression according to the number of decimal places specified by numdecimalplace using the round to nearest method and following the round half to even rule that is to return the possible numeric value closest to the value of the numeric expression with the appropriate number of decimal, and following the closest to the round halt to even rule when the numeric expression is exactly halfway between two possible rounded values. SyntaxRound(expression[, numdecimalplaces]) ArgumentexpressionRequired. Numeric expression being rounded.numdecimalplacesOptional. Number indicating how many places to the right of the decimal are included in the rounding. If omitted, integer value is returned by the Round function.ReturnsReturns a Variant of the same given number data subtype containing the rounded part of a given number that is to round a given numeric expression according to the number of decimal places specified by numdecimalplace using the round to nearest method and following the round half to even rule.Special returns of Round function: numberreturn valueNullRun-time ErrorEmpty0""Run-time Error Remarks
Requirement2ExamplesExamples of Round functions ASP VbScript Command:
HTML Web Page In-line Output:
Results on Microsoft Windows 8.1 Pro x64, Microsoft-IIS/8.5, VBScript Version 5.8 of page /internet/users/sideblog/default.asp varsnum, TypeNameEval("cmda1"), TypeNameEval(Eval("cmda1")), TypeNamenum=Null[], Null[Round(num)], String[error], errornum=Empty[], Empty[Round(num)], String[0], Integernum=""[], String[Round(num)], String[error], errornum=0[0], Integer[Round(num)], String[0], Integernum=4[4], Integer[Round(num)], String[4], Integernum=4:ndp=0[4], Integer[Round(num,ndp)], String[4], Integernum=4:ndp=1[4], Integer[Round(num,ndp)], String[4], Integernum=4E103[4E+103], Double[Round(num)], String[4E+103], Doublenum=4E103:ndp=0[4E+103], Double[Round(num,ndp)], String[4E+103], Doublenum=4E103:ndp=1[4E+103], Double[Round(num,ndp)], String[4E+103], Doublenum=4E-103[4E-103], Double[Round(num)], String[0], Doublenum=4E-103:ndp=0[4E-103], Double[Round(num,ndp)], String[0], Doublenum=4E-103:ndp=1[4E-103], Double[Round(num,ndp)], String[0], Doublenum=-4[-4], Integer[Round(num)], String[-4], Integernum=-4:ndp=0[-4], Integer[Round(num,ndp)], String[-4], Integernum=-4:ndp=1[-4], Integer[Round(num,ndp)], String[-4], Integernum=-4E103[-4E+103], Double[Round(num)], String[-4E+103], Doublenum=-4E103:ndp=0[-4E+103], Double[Round(num,ndp)], String[-4E+103], Doublenum=-4E103:ndp=1[-4E+103], Double[Round(num,ndp)], String[-4E+103], Doublenum=-4E-103[-4E-103], Double[Round(num)], String[0], Doublenum=-4E-103:ndp=0[-4E-103], Double[Round(num,ndp)], String[0], Doublenum=-4E-103:ndp=1[-4E-103], Double[Round(num,ndp)], String[0], Doublenum=12.142[12.142], Double[Round(num)], String[12], Doublenum=12.142:ndp=0[12.142], Double[Round(num,ndp)], String[12], Doublenum=12.142:ndp=1[12.142], Double[Round(num,ndp)], String[12.1], Doublenum=12.142:ndp=2[12.142], Double[Round(num,ndp)], String[12.14], Doublenum=12.142:ndp=3[12.142], Double[Round(num,ndp)], String[12.142], Doublenum=12.142:ndp=4[12.142], Double[Round(num,ndp)], String[12.142], Doublenum=12.968[12.968], Double[Round(num)], String[13], Doublenum=12.968:ndp=0[12.968], Double[Round(num,ndp)], String[13], Doublenum=12.968:ndp=1[12.968], Double[Round(num,ndp)], String[13], Doublenum=12.968:ndp=2[12.968], Double[Round(num,ndp)], String[12.97], Doublenum=12.968:ndp=3[12.968], Double[Round(num,ndp)], String[12.968], Doublenum=12.968:ndp=4[12.968], Double[Round(num,ndp)], String[12.968], Doublenum=-12.142[-12.142], Double[Round(num)], String[-12], Doublenum=-12.142:ndp=0[-12.142], Double[Round(num,ndp)], String[-12], Doublenum=-12.142:ndp=1[-12.142], Double[Round(num,ndp)], String[-12.1], Doublenum=-12.142:ndp=2[-12.142], Double[Round(num,ndp)], String[-12.14], Doublenum=-12.142:ndp=3[-12.142], Double[Round(num,ndp)], String[-12.142], Doublenum=-12.142:ndp=4[-12.142], Double[Round(num,ndp)], String[-12.142], Doublenum=-12.968[-12.968], Double[Round(num)], String[-13], Doublenum=-12.968:ndp=0[-12.968], Double[Round(num,ndp)], String[-13], Doublenum=-12.968:ndp=1[-12.968], Double[Round(num,ndp)], String[-13], Doublenum=-12.968:ndp=2[-12.968], Double[Round(num,ndp)], String[-12.97], Doublenum=-12.968:ndp=3[-12.968], Double[Round(num,ndp)], String[-12.968], Doublenum=-12.968:ndp=4[-12.968], Double[Round(num,ndp)], String[-12.968], Doublenum=11.535[11.535], Double[Round(num)], String[12], Doublenum=11.535:ndp=0[11.535], Double[Round(num,ndp)], String[12], Doublenum=11.535:ndp=1[11.535], Double[Round(num,ndp)], String[11.5], Doublenum=11.535:ndp=2[11.535], Double[Round(num,ndp)], String[11.54], Doublenum=11.535:ndp=3[11.535], Double[Round(num,ndp)], String[11.535], Doublenum=11.535:ndp=4[11.535], Double[Round(num,ndp)], String[11.535], Doublenum=11.525[11.525], Double[Round(num)], String[12], Doublenum=11.525:ndp=0[11.525], Double[Round(num,ndp)], String[12], Doublenum=11.525:ndp=1[11.525], Double[Round(num,ndp)], String[11.5], Doublenum=11.525:ndp=2[11.525], Double[Round(num,ndp)], String[11.52], Doublenum=11.525:ndp=3[11.525], Double[Round(num,ndp)], String[11.525], Doublenum=11.525:ndp=4[11.525], Double[Round(num,ndp)], String[11.525], Doublenum=-11.525[-11.525], Double[Round(num)], String[-12], Doublenum=-11.525:ndp=0[-11.525], Double[Round(num,ndp)], String[-12], Doublenum=-11.525:ndp=1[-11.525], Double[Round(num,ndp)], String[-11.5], Doublenum=-11.525:ndp=2[-11.525], Double[Round(num,ndp)], String[-11.52], Doublenum=-11.525:ndp=3[-11.525], Double[Round(num,ndp)], String[-11.525], Doublenum=-11.525:ndp=4[-11.525], Double[Round(num,ndp)], String[-11.525], Doublenum=-11.535[-11.535], Double[Round(num)], String[-12], Doublenum=-11.535:ndp=0[-11.535], Double[Round(num,ndp)], String[-12], Doublenum=-11.535:ndp=1[-11.535], Double[Round(num,ndp)], String[-11.5], Doublenum=-11.535:ndp=2[-11.535], Double[Round(num,ndp)], String[-11.54], Doublenum=-11.535:ndp=3[-11.535], Double[Round(num,ndp)], String[-11.535], Doublenum=-11.535:ndp=4[-11.535], Double[Round(num,ndp)], String[-11.535], Doublenum=5.555[5.555], Double[Round(num)], String[6], Doublenum=5.555:ndp=0[5.555], Double[Round(num,ndp)], String[6], Doublenum=5.555:ndp=1[5.555], Double[Round(num,ndp)], String[5.6], Doublenum=5.555:ndp=2[5.555], Double[Round(num,ndp)], String[5.56], Doublenum=5.555:ndp=3[5.555], Double[Round(num,ndp)], String[5.555], Doublenum=5.555:ndp=4[5.555], Double[Round(num,ndp)], String[5.555], Doublenum=-5.555[-5.555], Double[Round(num)], String[-6], Doublenum=-5.555:ndp=0[-5.555], Double[Round(num,ndp)], String[-6], Doublenum=-5.555:ndp=1[-5.555], Double[Round(num,ndp)], String[-5.6], Doublenum=-5.555:ndp=2[-5.555], Double[Round(num,ndp)], String[-5.56], Doublenum=-5.555:ndp=3[-5.555], Double[Round(num,ndp)], String[-5.555], Doublenum=-5.555:ndp=4[-5.555], Double[Round(num,ndp)], String[-5.555], Doublenum=12.565[12.565], Double[Round(num)], String[13], Doublenum=12.565:ndp=0[12.565], Double[Round(num,ndp)], String[13], Doublenum=12.565:ndp=1[12.565], Double[Round(num,ndp)], String[12.6], Doublenum=12.565:ndp=2[12.565], Double[Round(num,ndp)], String[12.56], Doublenum=12.565:ndp=3[12.565], Double[Round(num,ndp)], String[12.565], Doublenum=12.565:ndp=4[12.565], Double[Round(num,ndp)], String[12.565], Doublenum=-12.575[-12.575], Double[Round(num)], String[-13], Doublenum=-12.575:ndp=0[-12.575], Double[Round(num,ndp)], String[-13], Doublenum=-12.575:ndp=1[-12.575], Double[Round(num,ndp)], String[-12.6], Doublenum=-12.575:ndp=2[-12.575], Double[Round(num,ndp)], String[-12.58], Doublenum=-12.575:ndp=3[-12.575], Double[Round(num,ndp)], String[-12.575], Doublenum=-12.575:ndp=4[-12.575], Double[Round(num,ndp)], String[-12.575], Doublenum=13.152[13.152], Double[Round(num)], String[13], Doublenum=13.152:ndp=0[13.152], Double[Round(num,ndp)], String[13], Doublenum=13.152:ndp=1[13.152], Double[Round(num,ndp)], String[13.2], Doublenum=13.152:ndp=2[13.152], Double[Round(num,ndp)], String[13.15], Doublenum=13.152:ndp=3[13.152], Double[Round(num,ndp)], String[13.152], Doublenum=13.152:ndp=4[13.152], Double[Round(num,ndp)], String[13.152], Doublenum=-13.152[-13.152], Double[Round(num)], String[-13], Doublenum=-13.152:ndp=0[-13.152], Double[Round(num,ndp)], String[-13], Doublenum=-13.152:ndp=1[-13.152], Double[Round(num,ndp)], String[-13.2], Doublenum=-13.152:ndp=2[-13.152], Double[Round(num,ndp)], String[-13.15], Doublenum=-13.152:ndp=3[-13.152], Double[Round(num,ndp)], String[-13.152], Doublenum=-13.152:ndp=4[-13.152], Double[Round(num,ndp)], String[-13.152], Doublenum=13.848[13.848], Double[Round(num)], String[14], Doublenum=13.848:ndp=0[13.848], Double[Round(num,ndp)], String[14], Doublenum=13.848:ndp=1[13.848], Double[Round(num,ndp)], String[13.8], Doublenum=13.848:ndp=2[13.848], Double[Round(num,ndp)], String[13.85], Doublenum=13.848:ndp=3[13.848], Double[Round(num,ndp)], String[13.848], Doublenum=13.848:ndp=4[13.848], Double[Round(num,ndp)], String[13.848], Doublenum=-13.868[-13.868], Double[Round(num)], String[-14], Doublenum=-13.868:ndp=0[-13.868], Double[Round(num,ndp)], String[-14], Doublenum=-13.868:ndp=1[-13.868], Double[Round(num,ndp)], String[-13.9], Doublenum=-13.868:ndp=2[-13.868], Double[Round(num,ndp)], String[-13.87], Doublenum=-13.868:ndp=3[-13.868], Double[Round(num,ndp)], String[-13.868], Doublenum=-13.868:ndp=4[-13.868], Double[Round(num,ndp)], String[-13.868], Doublenum=13.555[13.555], Double[Round(num)], String[14], Doublenum=13.555:ndp=0[13.555], Double[Round(num,ndp)], String[14], Doublenum=13.555:ndp=1[13.555], Double[Round(num,ndp)], String[13.6], Doublenum=13.555:ndp=2[13.555], Double[Round(num,ndp)], String[13.56], Doublenum=13.555:ndp=3[13.555], Double[Round(num,ndp)], String[13.555], Doublenum=13.555:ndp=4[13.555], Double[Round(num,ndp)], String[13.555], Doublenum=-13.545[-13.545], Double[Round(num)], String[-14], Doublenum=-13.545:ndp=0[-13.545], Double[Round(num,ndp)], String[-14], Doublenum=-13.545:ndp=1[-13.545], Double[Round(num,ndp)], String[-13.5], Doublenum=-13.545:ndp=2[-13.545], Double[Round(num,ndp)], String[-13.54], Doublenum=-13.545:ndp=3[-13.545], Double[Round(num,ndp)], String[-13.545], Doublenum=-13.545:ndp=4[-13.545], Double[Round(num,ndp)], String[-13.545], Double Sources |
Sideway BICK Blog 12/03 |