title: Using Julia, how to format Avogadro's Constant (or other numbers) in engineering notation?
body: <p>Engineering notation differs from scientific notation in that:</p>
  <ol>
  <li><p>The exponent is always a multiple of 3, and</p>
  </li>
  <li><p>The digits to the left of the decimal point are scaled to range from 1 to 999.</p>
  </li>
  </ol>
  <p>My use case calls for specifying 0 to 13 digits to the right of the decimal point.  The default is 4.</p>
  <h1>Here are desired examples:</h1>
  <pre><code>const Avogadro = 6.022140857e23
  
  str = eng_notation(Avogadro, digits=0)             
  # str = &quot;602E+21&quot;
  
  str = eng_notation(Avogadro, digits=1)             
  # str = &quot;602.2E+21&quot;
  
  # Default 4 digits to right of decimal point.
  str = eng_notation(Avogadro)                       
  # str = &quot;602.2141E+21&quot;  
  
  str = eng_notation(Avogadro, digits=10)            
  # str = &quot;602.2140857000E+21&quot;
  
  # Negative and fractional numbers should also work.
  str = eng_notation(-0.01234567, digits=7)          
  # str = &quot;-12.4567000E-03&quot;
  </code></pre>
  <p>Any suggestions?</p>
  <h3>Edit:  I updated the requirements to 0 to 13 digits to the right of the decimal point (from 0 to 15 previously).</h3>