Permalink
Browse files

show some stats after the main menu

  • Loading branch information...
esmil committed Nov 11, 2012
1 parent 79b00b2 commit de8e5bd211eddb422cd7e1fce423ad7bf09e4e59
Showing with 5 additions and 0 deletions.
  1. +5 −0 drinkomatic.lua
View
@@ -32,6 +32,11 @@ local function main_menu()
print " 2 | Update or create new product."
print " - | Print this menu."
print "-------------------------------------------"
+
+ local r = assert(db:fetchone(
+ "SELECT SUM(balance)/COUNT(1), MIN(balance) FROM users"))
+ print(" Average balance: %16.2f DKK", r[1])
+ print(" Largest single debt: %16.2f DKK", r[2])
end
local function user_menu()

0 comments on commit de8e5bd

Please sign in to comment.