title: Format string into scientific notation
body: <p>I have a string that looks like this:</p>
  
  <pre><code>"0.4794255386042030002732879352156"
  </code></pre>
  
  <p>which is approximately the sin(0.5). I would like to format the string to look a much nicer</p>
  
  <pre><code>"4.794255386042e-1"
  </code></pre>
  
  <p>How can I achieve this? Remember I am dealing with strings and not numbers (float, double). Also I need to round to keep the number as accurate as possible, I can't just truncate. If I need to convert to a different data type I would prefer a long double because a regular double doesn't have enough precision. I'd like at least 12 decimal digits before rounding. Perhaps there is a simple sprintf() conversion I could do.  </p>