Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show some stats after the main menu

  • Loading branch information...
commit de8e5bd211eddb422cd7e1fce423ad7bf09e4e59 1 parent 79b00b2
@esmil esmil authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 drinkomatic.lua
View
5 drinkomatic.lua
@@ -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()
Please sign in to comment.
Something went wrong with that request. Please try again.