title: Convert string to decimal with precision in web3 fromWei method
body: <p>I have a value <code>169482670391774</code> and I know that it should be converted to decimal and has <code>9</code> digits after comma, so in this example value after conversion should be <code>169482.670391774</code>.</p>
  <p>How to convert this value?</p>
  <p>What I have so far is:</p>
  <pre><code>let mapping = web3.utils.unitMap;
  
  let valuePrecision = &quot;&quot;;
  for (var i = 0; i &lt; accuracy; i++) {
     valuePrecision = valuePrecision + &quot;0&quot;;
  }
  let unitMapValue = 1 + valuePrecision;
  let unitMapKey = '';
  
  for (const key in mapping) {
   if (mapping[key] === unitMapValue) {
    unitMapKey = key;
   }
  }
  
  let inTxnsInToken = web3.utils.fromWei(web3.utils.toBN(inTxns).toString(), unitMapKey);
  let outTxnsInToken = web3.utils.fromWei(web3.utils.toBN(outTxns).toString(), unitMapKey)
  </code></pre>
  <p>And this is working but I am feeling that this is not the best method and I can't use:</p>
  <p><code>web3.utils.toBN(inTxns).toString(), 1000000000)</code></p>