Just after posting I stumbled across this function that works. It may not be the best way or most efficient, but it works and we're happy with that.
functionZeroPadNumber( nValue )
{
if( nValue <10)
{
return('000'+ nValue.toString ());
}
elseif( nValue <100)
{
return('00'+ nValue.toString ());
}
elseif( nValue <1000)
{
return('0'+ nValue.toString ());
}
else
{
return( nValue );
}
}