Parses the specified number string using the specified base system.
number - our number to format from one base system to another.
from - the base system to interpret the number with. (default is 10)
to - the base system to format the number into, default is 10. The following table contains a few options, really this function is flexible towards any base system you choose to specify.
Base Description 2 binary 8 octal 10 decimal 16 hex
A long scalar resulting from parsing the number string with the specified base.
$value = formatNumber(4919, 16); println("4919 is: 0x $+ $value"); $value = formatNumber(137, 2); println("137 is: $value");
4919 is: 0x1337 137 is: 10001001