Support encoding of any float value

If value is a float, the binary floating point value is losslessly converted to its exact decimal equivalent. That means float(1.1) != Decimal(float(1.1)). Here we first convert the float to a string using the highest precision possible. The string is then converted to a Decimal and normalized to remove rightmost trailing zeros.