title: float datatype getting changed to int in javascript
body: <p>We have a very old JavaScript SDK(Built in core javascript) and making changes in this script in this SDK is very difficult.</p>
  <p>We have this function in the script SDK.dispatch(&quot;action&quot;, value). This function has to be called by the client webiste, and they can pass any type of data to it. We have now a situation where the client is calling SDK.dispatch(&quot;add to cart&quot;, {item: &quot;name&quot;, price: 120.00}. The 120.00 is a float The back end requires both value and data type.</p>
  <p>However, the JavaScript intrinsic changes 120.00 from float to int and since we cannot know the data type from beforehand we are passing the wrong data type to the backend.</p>
  <p>I am looking for some type of insight as to how to maintain the Data and its type in JavaScript sdk. Eg.</p>
  <pre><code>smartech('dispatch', 'myEvent', {price: 115.00});
  // this line of code executed by client and 
  // we don't have control over the value of price and data type
  function dispatch(event, payload) {
   // event = myEvent
   // payload = {price: 115.00} 
   /* in this price attribute is a float send by a client but gets converted to integer by JavaScript we need the datatype to be maintained by JS as our backend required datatype, or it breaks
   */
  
   /* 
      Business logic : send data to backend
   */
  
   var promise = new Promise (function (resolve, reject) {
      var xhttp = new XMLHttpRequest();
    xhttp.onreadystatechange = function() {
      /*if (this.readyState == 4 &amp;&amp; this.status == 200) {
       resolve(true);
      } else {
       reject(false);
      }*/
    };
    xhttp.open(&quot;POST&quot;, &quot;backendURL&quot;, payload);
    xhttp.send();
   });
  }
  </code></pre>
  <p>How can I maintain a datatype of payload while accepting data to my function. As my backend strictly depends on datatype.</p>
  <p>I have tried this on browser console also</p>
  <pre><code>var a = 210.00;
  console.log(a);
  </code></pre>
  <p>in console i got 210 which is integer.</p>
  <p>since expected to my backend is float but i am getting int value , so my backend is discarding those calls.I know this is very corner case but i need to handle it globally.</p>