How about extending the variables? {{10|m2}} would be 10 square meters {{50|ft}} would be 50 feet etc.
The pipe is unnecessary, and the {{ }} does not look very readable. How about double backtics or double underscores? (``50 cm``, __50 cm__). Backtics are common in Unixland for stuff that is dynamically interpreted and replaced.
Regards,
Erik