title: How do you round a double in Dart to a given degree of precision AFTER the decimal point?
body: <p>Given a double, I want to round it to a given number of points of precision <em>after the decimal point</em>, similar to PHP's round() function.</p>
  
  <p>The closest thing I can find in the Dart docs is double.toStringAsPrecision(), but this is not quite what I need because it includes the digits <em>before</em> the decimal point in the total points of precision.</p>
  
  <p>For example, using toStringAsPrecision(3):</p>
  
  <pre><code>0.123456789 rounds to 0.123  
  9.123456789 rounds to 9.12  
  98.123456789 rounds to 98.1  
  987.123456789 rounds to 987  
  9876.123456789 rounds to 9.88e+3
  </code></pre>
  
  <p>As the magnitude of the number increases, I correspondingly lose precision after the decimal place.</p>