title: How to format decimal as a string with defined precision using printf/sprintf in F#?
body: <p>I want to format decimal value as string with a defined precision in F#. While using printf/sprintf I get:</p>
  
  <pre><code>let sdecimal = sprintf "%.2M" 0.1234M;;
  </code></pre>
  
  <blockquote>
    <p>val sdecimal : string = "0.1234"</p>
  </blockquote>
  
  <p>while for float it works.</p>
  
  <pre><code>let sfloat = sprintf "%.2f" 0.1234;;
  </code></pre>
  
  <blockquote>
    <p>val sfloat : string = "0.12"</p>
  </blockquote>
  
  <p>Seems like I have to first cast it to float which is both verbose and non-kosher.</p>
  
  <p>Is there a simpler way than using C#'s .ToString() formatting?</p>