I want to format a double variable to have two decimal places no matter what. Is there a way to do this without lengthy code?

Example:

Code:
4      -> 4.00
4.4   -> 4.40
4.44 -> 4.44
etc..