Control precision/printing of exponential numbers
<p>What is the best way to control printing of 64-bit floating point numbers in Python?</p>

<p>I can use the <code>%e</code> specifier to easily show all numbers in exponential format.  However, I only want to use exponential format if the number has more than x amount of digits in it.  For example, below is the raw 64-bit floating point number and what I would like it to look like as a string:</p>

<pre><code>value       what's printed

1.123456    1.123456
123456.1234 12345.6e4
1.0         1.0
.1234567    1.23456e-1
</code></pre>

<p>Above I only want to see 7 digits total and then convert to exponential notation if there are more needed.</p>

<p>Does this make any sense?  Essentially I would like to be able to use exponential notation only when some threshold for the number is reached.  I know <code>%e</code> allows specifiers like <code>%.3e</code> but this will always use exponential notation regardless of the number size.</p>
