Simple JS unit conversion utility