Formats a given value as a string with a given number of decimal digits.
Formats a given value as a string with a given number of decimal digits.
the value to format
the number of decimals. this must be >= 0 and <= 3, otherwise throws an exception
if greater than zero, the number of characters to pad the output string to, possibly prepending white-space