Why limit it to a particular base?

code:
$iNewValue=BaseConvert($iOldValue,CurrentBase,RequiredBase, Optional WordSize)

The Optional WordSize would be required to deal with negative numbers and overflows.