Fonction Oct VBScript

Définition et utilisation

La fonction Oct peut retourner une chaîne de caractères représentant la valeur octale d'un nombre spécifié.

Commentaires :Si number Si le paramètre n'est pas un entier, il est arrondi au plus proche entier avant l'opération.

Syntaxe

Oct(number)
Paramètres Description
number

obligatoire. Toute expression valable.

Si number Est :

  • Null - alors la fonction Oct retournera Null.
  • Vide - alors la fonction Oct retournera zéro (0).
  • Autres nombres - alors la fonction Oct retournera au plus 11 caractères hexadécimaux.

Exemple

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))

Sortie respective :

3
5
11
12
13
14
620
713
714

Essayer vous-même