title: Decimal format number React
body: <p>I use axios for API queries and NumberFromat to change the decimal number. Here is the App.js:</p>
  
  <pre><code>import React, { Component } from 'react';
  import './App.css';
  import axios from 'axios';
  import web3 from "./web3";
  import NumberFormat from 'react-number-format';
  
  export default class PersonList extends React.Component {
    state = {
      balance: '',
      bn: '',
      persons: []
      };
  
    async componentDidMount() {
      const balance = await web3.eth.getBalance("0x2f6aA9e80385316eEe006AB8bB7943abF333A063") / 1e18;
      const bn = financial(balance);
      const axios = require('axios');
  
      function financial(x) {
        return Number.parseFloat(x).toFixed(2);
      };
  
      axios.get(`https://api.coinmarketcap.com/v1/ticker/ethereum/?convert=USD`)
        .then(res =&gt; {
          const persons = res.data;
          this.setState({ persons });
        })
  
      this.setState({ balance, bn });
      };
  
    render() {
  
  
      return (
        &lt;div&gt;
          &lt;p&gt;
            {this.state.persons.map(person =&gt; &lt;p&gt;"portfolioValue": {this.state.bn}, "usdeth": {person.price_usd}&lt;/p&gt;)}
          &lt;/p&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>
  
  <p>It's displayed as</p>
  
  <blockquote>
    <p>"portfolioValue": 0.06, "usdeth": 93.270616772</p>
  </blockquote>
  
  <p>So, I need to change the number of decimals of the second value like so 93.27. Looks like the easy task, but I stuck with it.</p>