VBScript Oct関数

定義と用法

Oct関数は指定された数字の8進数を表す文字列を返します。

注釈:もし number パラメータが整数でない場合、演算前に最も近い整数に四捨五入します。

文法

Oct(number)
パラメータ 説明
number

必要です。どんな有効な式でも。

もし number は:

  • NULL - その場合、Oct関数はNULLを返します。
  • 空 - その場合、Oct関数は0を返します。
  • 他の数 - その場合、Oct関数は最長11個の16進数文字を返します。

document.write(Oct(3))
document.write(Oct(5))
document.write(Oct(9))
document.write(Oct(10))
document.write(Oct(11))
document.write(Oct(12))
document.write(Oct(400))
document.write(Oct(459))
document.write(Oct(460))

それぞれ出力される:

3
5
11
12
13
14
620
713
714

実際に試してみてください