Move double formatting method to DoubleUtils