def decimalToString(val):
    """
    Convert a decimal into a string.
    The advantage over applying "str" on a decimal is that the string representation returned here
    is minimal, i.e. no unnecessary trailing zeros or dot

    Params:
    - val (decimal.Decimal): Decimal to convert

    Return (str): String representation
    """

    # NOTE: We do not use the "normalize" method on decimal.Decimal as it forces scientific notation
    val = str(val)
    if "." in val:
        lhs, rhs = val.split(".", 1)
        lhs = lhs.lstrip("0") or "0"
        rhs = rhs.rstrip("0")
        if rhs:
            val = ".".join((lhs, rhs))
        else:
            val = lhs
    return val