@chinchang: If you replace the eval() with math.eval from http://mathjs.org/ here
result = eval(match[1]);
You'll get access to many more functions, including unit conversions.