<p>Python Decimal doesn't support being constructed from float; it expects that you have to convert float to a string first.</p>
<p>This is very inconvenient since standard string formatters for float require that you specify number of decimal places rather than significant places.  So if you have a number that could have as many as 15 decimal places you need to format as <code>Decimal(&quot;%.15f&quot; % my_float)</code>, which will give you garbage at the 15th decimal place if you also have any significant digits before decimal (<code>Decimal(&quot;%.15f&quot; % 100000.3) == Decimal('100000.300000000002910')</code>).</p>
<p>Can someone suggest a good way to convert from float to Decimal preserving value as the user has entered, perhaps limiting number of significant digits that can be supported?</p>

The "official" string representation of a float is given by the repr() built-in:
```
```
>>> repr(1.5)
'1.5'
>>> repr(12345.678901234567890123456789)
'12345.678901234567'
```
```
You can use repr() instead of a formatted string, the result won't contain any unnecessary garbage.