def trim_leading_trailing_zeros(value):
    """
    Trim leading zeros:
        "0.3" > ".3"
        "-0.3" > "-.3"
    Trim trailing zeros:
        "1.0" > "1"
    """
    if value.startswith("0."):
        value = value[1:]
    if value.startswith("-0."):
        value = "-" + value[2:]
    if value.endswith(".0"):
        value = value[:-2]
    if value == "":
        value = "0"
    return value