The description for the $num function in the help file is "Pad decimal number with leading zeros" but it only returns the integer part of a decimal number with leading zeros.
i.e. if x=1.1
$num(x,2) returns 01
$num(x,3) returns 001
Either the decription is wrong or the function is not working.