I am dealing with a bug where applying the str function to an instance of decimal.Decimal gives me the string '0E-1000'. I expected that str applied to a Decimal would always give me a string of the form -?[0-9]+(\.[0-9]+), which is what I want.
Firstly, if I understand correctly, the scientific notation '0E-1000' represents 0 x 10^-1000, i.e. zero. Why am I getting this particular representation of zero? Why not '0E-42', which is the same?
Secondly, I cannot manually construct a Decimal which reproduces this bug. The buggy Decimal instance comes from an external source. The expression str(Decimal(0)) evaluates to '0' in the REPL. How can I construct an instance d of Decimal for which str(d) evaluates to '0E-1000'?
EDIT: Thirdly, how can I convert an arbitrary Decimal instance to a string in, you know, decimal notation?
models.DecimalField(max_digits=1000, decimal_places=1000, blank=True, null=True).