[数値の整数部分を取得する]

整数部分を取得する関数は、Fix 関数と Int 関数の2つがあります。
負の数を指定した場合は、それぞれで結果が異なります。

【ソースコード】
[tips0009.vbs]
Option Explicit

Dim dblValue    ' 数値

dblValue = 123.45
WScript.Echo dblValue & "の整数部分(Fix)は" & Fix(dblValue) & "です。"
WScript.Echo dblValue & "の整数部分(Int)は" & Int(dblValue) & "です。"
dblValue = -123.45
WScript.Echo dblValue & "の整数部分(Fix)は" & Fix(dblValue) & "です。"
WScript.Echo dblValue & "の整数部分(Int)は" & Int(dblValue) & "です。"

【実行結果】
C:\> cscript //NoLogo tips0009.vbs
123.45の整数部分(Fix)は123です。
123.45の整数部分(Int)は123です。
-123.45の整数部分(Fix)は-123です。
-123.45の整数部分(Int)は-124です。