Angular 2: How to set double, float, int & boolean type params in GET & POST requests
<p>In Angular 2 we are using <strong>URLSearchParams</strong> to set URL parameters in <strong>GET</strong> &amp; <strong>POST</strong> requests.</p>

<pre><code>var params = new URLSearchParams();
params.set('param1', param1);
</code></pre>

<p>I am using following way to use <strong>double</strong> and <strong>int</strong> type params.</p>

<pre><code>longitude: number;
size: number;
params.set('longitude', longitude.toString());
params.set('size', size.toString());
</code></pre>

<p>But we can use only String type parameters here. What would be the best way to use <strong>double</strong>, <strong>float</strong> and <strong>boolean</strong> type parameters ?</p>