def format_decimal_as_string(value):
    """
    Convert a decimal.Decimal to a fixed point string. Code borrowed from
    Python's moneyfmt recipe.
    https://docs.python.org/2/library/decimal.html#recipes
    """
    sign, digits, exp = value.as_tuple()
    if exp > 0:
        # Handle Decimals like '2.82E+3'
        return "%d" % value
    result = []
    digits = list(map(str, digits))
    build, next = result.append, digits.pop
    for i in range(-exp):
        build(next() if digits else '0')
    build('.')
    if not digits:
        build('0')
    while digits:
        build(next())
    if sign:
        build('-')
    return ''.join(reversed(result))