Basic formatting function added for output.

Output can be formatted to remove trailing zeroes and some floating
point inaccuracy.