title: How to format numeric values with pattern?
body: <p>I'm finding an equivalent to <a href="https://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html" rel="nofollow noreferrer">Java's DecimalFormat</a> in JavaScript. I would like to format given numeric values with given decimal pattern like </p>
  
  <pre><code>"#,###.00"
  "###.##"
  "#,###.##"
  "$#,##0.00"
  "###,###.00"
  "$###,###.00"
  "###,###.###"
  "####,####.000"
  </code></pre>
  
  <p>Has there any way to achieve it?</p>