title: How to use the angular decimal pipe in typscript
body: <p>I'm using the <a href="https://angular.io/api/common/DecimalPipe#description" rel="nofollow noreferrer">angular decimal pipe</a> like this:</p>
  <pre><code>// Typescript
  @Component({...})
  export class ConfusionMatrixComponent {
  
      @Input()
      roundRules = '1.0-2';
  }
  
  // HTML:
  &lt;div class=&quot;value&quot;&gt;{{ getIntensityNumber(i) | number: roundRules }}&lt;/div&gt;
  </code></pre>
  <p>How can I use the same pipe but on a typescript function?</p>