The arithmetic operations are easy: fill in the arguments in the yellow form fields, and press the operation button. The result should show up in the blue field. An exception is the reciprocal (1/x) which inverts in place the argument (in the second yellow field).
The financial operations need some knowledge in financial mathematics. Fill the four known parameters, and press the button of the (fifth) parameter that you want to calculate. For example, you may want buy a car in installments. Let's suppose that the car price is $20.000, you want to pay it in 36 monthly payments, and the interest is 3%/month (ok, you are probably shocked with this. Brazilian interest is reeealy high!). To summarize:
Another example: you may want to set up a $100,000 fund. You have no money now, but you can deposit $1,000 every month. You have selected an investiment fund that pays 12%/year (1%/month). How many time you need to save $100,000?
The small form field in the lower right corner, whose default value is "2", is the decimal precision of results.
The BEGIN button, when toggled on, means that the first payment (PMT) is paid in the beginning of the period. One example (more meaningful to Brazilian readers) is something bought in 1+9 installments, that is, 10 payments being the first right now. When BEGIN is disabled, the first payment is one period away from now.
The CFP toggle button tells whether the first fractional periodo should be calculated with simple interest (disabled) or compound interest (enabled). The difference is generally negligible, and non-integer "n" values are not common.
For the sake of completeness, here goes an example: a loan to be paid in 75 days, interest of 10%/month, loaned value is $1,000. Which will be the debt after 75 days?
"Egg" is a packaging format for Python software. The main feature of Egg is being as portable as Python itself - allowing the same package to be installed either in Windows or Linux. TurboGears itself is distributed as Egg files, and it makes very easy for us to make Eggs from our own projects/sites.
Nothing prevents one from distributing a TG project in Tar or Zip packages, but Egg packages are more kosher since they embed version and dependency data (which are very handy when you need to distribute upgrades of your project).
In order to create the Egg package from your project, make
[epx@biker ajaxfin]$ python setup.py bdist_egg running bdist_egg running egg_info writing requirements to ajaxfin.egg-info/requires.txt writing ajaxfin.egg-info/PKG-INFO ... more messages ... creating 'dist/ajaxfin-1.0-py2.4.egg' and adding 'build/bdist.linux-i686/egg' to it removing 'build/bdist.linux-i686/egg' (and everything under it) [epx@biker ajaxfin]$ ls -ls dist/ total 20 20 -rw-r--r-- 1 epx epx 20041 Jun 12 21:05 ajaxfin-1.0-py2.4.eggIt is interesting to note that an Egg file is in fact a Zip with metadata, as shown below:
[epx@biker ajaxfin]$ unzip -t dist/ajaxfin-1.0-py2.4.egg Archive: dist/ajaxfin-1.0-py2.4.egg testing: ajaxfin/controllers.pyc OK testing: ajaxfin/json.py OK testing: ajaxfin/release.py OK testing: ajaxfin/json.pyc OK ... more files ... testing: EGG-INFO/requires.txt OK testing: EGG-INFO/scripts/start-ajaxfin.py OK No errors detected in compressed data of dist/ajaxfin-1.0-py2.4.egg.
The project is available in Egg and Tar package formats. It was developer for TurboGears 0.9a6; you must install version 0.9a6 or better to run it.
In order to install the Egg package (just in case you do not remember how you did to install TG itself), do
/home/epx $ python ez_setup.py ajaxfin-1.0-py2.4.egg
If you don't have the ez_setup script, download it someway, like this example:
/home/epx $ wget http://www.turbogears.org/preview/download/ez_setup.py
The Tar package contains a simple "dumping" of the project folder. Just unpack it anywhere you want.
<<< Back to beginning of tutorial