I am writing a long document, which has a lot of money references in Indian rupees (easily typeset using package tfrupee).
Some definitions peculiar to Indian money before we proceed:
- Its grouped as ..,2,2,3. For instance, 100,000 is written as 1,00,000. (This is not particularly relevant to the question below, but the factoid is mentioned here for completeness).
- Currency unit lakh = hundred thousand (100,000)
- Currency unit crore = hundred hundred thousand (10000000).
Back to the question.
However, some of the audience of this document is going to be based in the US and Europe. So, I want to define the following (metacode).
\usepackage{tfrupee}
\usepackage{eurosym}
\newcommand{\scalefactor}[#1]{100000 if lakh and 10000000 if crore}
\newcommand{\rupeetodollars}{60.08} % Number of rupees to a dollar these days.
\newcommand{\rupeetoeuros}{82.32} % Number of rupees to a Euro these days.
\newcommand{\actualindianmoney}[2]{#1*\scalefactor{#2}}
\newcommand{\indianmoney}[2]{\rupee #1 #2\footnote{\$ \actualindianmoney{#1}{#2}/\rupeetodollars}. \eurosym \actualindianmoney{#1}{#2}/\rupeetosuros.}
with invocations like:
\indianmoney{10}{lakh} and \indianmoney{2}{crore}.
However, I have never done any floating point calculation (fp vs. pgfmath) using \LaTeX and how to convert lakh to 100000 and crore to 10000000 (to do the sensible multiplication above) as well as ensure only two decimal places in the result is throwing me.
Could someone help me out here?
PS: Is it possible to get compile time values for the exchange rates above instead of hardcoding numbers that may be obsolete in a few weeks (Though it has settled down of late, the Indian rupee has been one of the more volatile currencies around for the past two years).
