Skip to content

Instantly share code, notes, and snippets.

View dgreenbe77's full-sized avatar

Daniel Greenberg dgreenbe77

  • Hirefrederick, Inc.
  • San Francisco, CA
View GitHub Profile
@dgreenbe77
dgreenbe77 / gist:9074781
Last active August 29, 2015 13:56
Cashier.rb
puts "What is the amount due?"
amount_due = gets.chomp.to_f
puts "What is the amount tendered?"
tendered = gets.chomp.to_f
total = tendered - amount_due
new_total = sprintf('%.2f', -total)
other_total = sprintf('%.2f', total)
@time = Time.new.strftime("%D %H:%M")