
Expense Calculator - chicken_lady
http://c2.com/doc/expense/
======
skrebbel
This is genius. A markdown for spreadsheets.

I wonder whether it would be possible to extend this concept to get more
powerful features, inspired by spreadsheets (and programming languages maybe).
Sometimes you need more than a sum or an average, but writing out the formulas
in full, repeatedly, seems like a lot of cognitive overhead.

I see in this thread that Emacs org-mode has something like it, but I'm not
convinced that stuff like

    
    
        #+TBLFM: @2$4=vmean($2..$3)
    

matches the humane, readable, Markdown-esque approach that I'd want to use.

------
zrail
This is very clever. Of course, coming from Ward it's hard to expect anything
less :)

Again, I'd like to plug [http://www.ledger-cli.org](http://www.ledger-
cli.org). It's similar in spirit, with a reporting program reading a lightly
formatted text file.

------
ovechtrick
Reminds me of Soulver.
[https://itunes.apple.com/us/app/soulver/id413965349?mt=12](https://itunes.apple.com/us/app/soulver/id413965349?mt=12)

~~~
samweinberg
Calca, too. The awk script should do if you want something simpler, but I'd
recommend either Soulver or Calca for their extra features.

------
jetro223
Clever solution - technically. For trips with my friends we use a "money-pot"
system where everyone pays a fixed amount into a pot before the trip and
everything we do or buy together is paid out of this pot. After the trip the
calculation is much easier - refund = (remaining amount / persons) ;-)

------
stiff
You can do those kinds of quick reports in text files conveniently in emacs
org-mode nowadays:

[http://orgmode.org/org.html#The-spreadsheet](http://orgmode.org/org.html#The-
spreadsheet)

~~~
nodivbyzero
I didn't know about this one. Nice!!!

------
simonnreynolds
[http://www.splitwise.com](http://www.splitwise.com) circa 1981?

------
bernardeli
I'm very impressed. That is the shortest version of expense calculation I've
ever seen.

I have written a python script back in 2007 for calculating two trips
expenses:
[https://github.com/bernardeli/trip_money_organizer](https://github.com/bernardeli/trip_money_organizer)

I'm not a Python developer myself, however I was pretty happy with the result.
I know it works fine, and have used few times with no issues.

~~~
fifthesteight
I found the code itself to be beautiful, as well.

------
keyle
Clever pre-excel solution. In a way, ahead of its time, similar to MarkDown.

~~~
johansch
Post-visicalc though :).

~~~
fit2rule
Awk came after visicalc? Really? Wow.

------
genericresponse
If anyone doesn't realize Ward is the same guy who created the Wiki.

------
jzwinck
The program needn't be a shell script invoking awk--you can use a "shebang"
line to make the entire thing an awk file. This will help if you use an editor
which understands awk syntax (for highlighting etc.). Of course in 1981 you
probably didn't have such luxuries, but today we can just remove the "exec
awk", the outer quotes and $1, and put this as the first line:

    
    
        #!/usr/bin/awk -f

------
dnr
These days you should use Splitwise:
[https://www.splitwise.com/](https://www.splitwise.com/)

(Not affiliated, just a happy user. And there's a nice network effect if more
people use it, so more people should use it.)

