Module: TokenHawk::CLI::Formatter
- Included in:
- Commands::Costs, Commands::Efficiency, Commands::Recent
- Defined in:
- lib/token_hawk/cli/formatter.rb
Instance Method Summary collapse
Instance Method Details
#format_cost(cents) ⇒ Object
6 7 8 9 10 |
# File 'lib/token_hawk/cli/formatter.rb', line 6 def format_cost(cents) return "$#{"%.2f" % (cents / 100.0)}" if cents >= 100 "#{cents}¢" end |