Saturday, December 1, 2012

Inflation calculator for Mexico

How much was worth it?
It really doesn't bother me, but it is somewhat annoying.
From time to time I come across monetary figures in books & texts. Nothing wrong with that, especially since X number of dollars is X number of dollars. Having spent a fair amount of those I can relate to what the figures mean. As you can guess, this is only true for relatively recent figures. Inflation messes perception up and if the figures you're reading about are somewhat dated, it gets difficult to get a sense of what they actually amount to. Were, say, five 1962 dollars a princely amount or were they something you could walk by without a second glance were you to find them lying on the street? How can one tell?
Calculator & gold coins; source:; by Benjamin MillerThere are formulas that solve this problem by bringing, so to speak, any amount to the present by reflecting the inflation of intervening years; though not overly complicated, these nevertheless cannot be applied in a jiffy. That's why I decided to write my own inflation calculator. I quickly found out that there were already a number of those on the net for the US dollar. Not wanting to duplicate them, I decided to switch to the Mexican peso. To that end, I researched the consumer price data and taught myself some HTML (too basic perhaps, as the page looks dated) and Perl language for the CGI programming. The hardest part was to get the Perl and the HTML talk to each other, but after some trial and error I got it working. This was back, around 2006 or 2007 and I have been updating it with the latest data since.

Here goes:
If you have to deal with the Mexican peso, the calculator has some nice features. Firstly, it goes back to 1878, which is way farther back than what the Mexico's central bank provides for its own online calculator. Secondly, it is easier to input information. Thirdly, it outputs more than just two decimal points. Fourthly, it not only gives you the accumulated inflation for the given period, but also the average inflation for said period. Fifthly, it lets you enter whatever amount, for example, 1,000,000, and reflecting the inflation to that amount, not just the raw inflation percentage increase. What I believe to be it lacking is getting from it monthly, rather than yearly information. I did not integrate this feature because it's more difficult for the user to input the monthly data (and for me, to get the records).

For the future, if I can get hold of the data, I might rewrite the calculator for use with other currencies.

Update 9/25/14: Boosted my HTML and CSS powers with this and now the page looks less ancient.

Update 1/23/15: Added an Easter egg to the calculator a couple of weeks ago. Working on another.


fjg said...

Dear Carl, I want to use your inflation calculator for Mexico and cite it in an analysis of changing costs of production for producers in Oaxaca. Do you have any institutional affiliation? Can I have your full name for the citation? Please email me at Thanks so much for creating this calculator. I hope to hear from you.

Carl05 said...

Hi, thanks for your interest. Feel free to cite the calculator page, this post or the actual sources. I claim no original research; just the calculator assembly. I am an individual and have no links to any oficial institution if that's of any use(I'm independent, yay!). Hope that your project meets with great success. 05

Post a Comment