def convert_value(var):
    """Convert the metric value from string into python type."""
    if var["type"] == "number":
        return float(var["value"])
    if var["type"] == "boolean":
        return var["value"] == "true"
    if var["type"] == "string":
        return var["value"]

    print("can't convert unknown type {} for var {}".format(var["type"], var["name"]))
    return None