See also: binToDec, hexToDec

Converts an octal number string to a decimal.

Syntax

JSV_octToDec(expO)

Prototype

expO.octToDec()

Returns

The octToDec function returns the decimal number of the octal number string.

Parameters

The octToDec function uses the following arguments.

Argument Description
expO The octal number string that is to be converted to a decimal.

Remarks

There is no checking whether expO is a binary string. Users of this function should check that the value of expO is a valid argument to this function.

Uses the parseInt function to return an integer representing the specified binary string. If the first character cannot be converted to a number, parseInt returns NaN.

Dependencies

n/a

Example

The following lines of code

var f = "1554";
document.write( "The number " + f + " is decimal " + JSV_octToDec(f) );
f = "741";
document.write( "The number " + f + " is decimal " + JSV_octToDec(f) );

produce