format total cost