docs: def format_decimal(decimal):
      """
      Formats a decimal number
      :param decimal: the decimal value
      :return: the formatted string value
      """
      # strip trailing fractional zeros
      normalized = decimal.normalize()
      sign, digits, exponent = normalized.as_tuple()
      if exponent >= 1:
          normalized = normalized.quantize(1)
  
      return str(normalized)