Dez, you can use whatever server-side language you like (as long as it's supported by the server), for something as simple as unit conversion I wouldn't go with Ruby or Python because they would be overkill, but PHP, ASP(.NET), JSP, Perl or ColdFusion would do the job (depending on your preference and what your host supports).
You haven't explained how site B fits into your having a calculator on your site.
All that is normally involved in setting up a calculator like that is the one site that the calculator is on. Any other site can then use the calculator simply by providing a link to the page that the calculator is on.
It all comes down to what server side languages your hosting provides for you to use and which of those if any that you already know. If your hosting provides several languages and you don't know any of them yet then it comes down to which one you decide to learn.
PHP has a slight advantage over some of the alternatives that you are likely to find on the same hosting as there are more people using it and therefore more people to get help from.