Formats a double value with the specified number of decimal places.
Formats a float value with the specified number of decimal places.