Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

Math.convertBase

Math.convertBase($n, $fromBase, $toBase)

Description

Convert $n from one base to another.

Non-decimal results are returned as a String.

Math.convertBase(21, 10, 2);
//= '10101' (decimal to binary)

Math.convertBase('1af9', 16, 10);
//=  6905   (hex to decimal)