title: Validation Error in paypal checkout
body: <p>I am using PayPal checkout script on Angular5. </p>
  
  <p>I am trying to split a string which contain the price and convert the result to float, but I get the following error:</p>
  
  <pre><code>{
  "name": "VALIDATION_ERROR",
  "details": [
      {
          "field": "transactions.amount",
          "issue": "Currency amount must be non-negative number, may optionally contain exactly 2 decimal places separated by '.', optional thousands separator ',', limited to 7 digits before the decimal point and currency which is a valid ISO Currency Code"
      }
  ],
  "message": "Invalid request - see details",
  "information_link": "https://developer.paypal.com/docs/api/payments/#errors",
  "debug_id": "ea4b3e3713de"
  }
  
  request/&lt;/&lt;@https://www.paypalobjects.com/api/checkout.js:14680:39
  </code></pre>
  
  <p>Here is my paypal config:</p>
  
  <pre><code>let price = parseFloat(this.objRate.split("$")[1]);
  let amount = 1;
  
  let total = price * amount;
  this.payPalConfig = {
    env: 'sandbox',
    client: {
      sandbox: '&lt;key&gt;',
      production: '&lt;key&gt;'
    },
    commit: true,
    payment: (data: any, actions: any) =&gt; {
      return actions.payment.create({
        payment: {
          transactions: [{
            amount: {
              currency: "USD",
              total: Number(total).toFixed(2)
            }
          }]
        }
      });
    },
    onAuthorize: (data: any, actions: any) =&gt; {
      return actions.payment.execute().then((payment: any) =&gt; {
        this.payPalSuccess = true;
      });
    }
  </code></pre>
  
  <p>Thanks in advance</p>