title: How to convert a number to double data type in javascript/ typescript?
body: <p>I have one input filed where the user can enter any numbers 
  eg: 12  12.1  12.30 12.34
  I have to pass this value in a service call here i can only send the value as <strong>number but with 2 decimal points</strong> </p>
  
  <pre><code>let a = input //a will be a type of number
  let b = a.toFixed(2) //b will be type of string
  let c = Number(b) //it will automatically cut unwanted '0'
  console.log(c);
  </code></pre>
  
  <p><strong>EXAMPLE</strong></p>
  
  <pre><code>//input is 12
  a=12
  b="12.00"
  c=12
  
  //input is 12.30
  a=12.30
  b="12.30"
  c=12.3
  </code></pre>
  
  <p><em>I want a method, using which i can input a value as a number and output will be number with 2 decimal points.</em></p>