Implementing simple output formatting for Cost class