Help me make a unit conversion script

Asgorath

[H]ard|Gawd
Joined
Jul 12, 2004
Messages
1,253
Throughout my website I have dimensions in inches. I would like to be able to put a small bit of code wherever an inches dimension is mentioned, and have the display come out also in cm. I know PHP can do this, but I don't know how to write it, could someone help?

Example:

Display Before:

10"

Code: (I don't know proper code, so just work with me here)

inToCm(10);

Display After:

10" (25.4 cm)

I would like the cm dimension to one decimal point.

If anyone would like to help me with this, it would be much appreciated.
 
Back
Top