【问题标题】:how to import web3.utils.fromWei Library in my javascript simple code如何在我的 javascript 简单代码中导入 web3.utils.fromWei 库
【发布时间】:2022-06-14 05:52:32
【问题描述】:

我想使用web3.utils.fromWei库https://web3js.readthedocs.io/en/v1.2.11/index.html,但我不知道如何在我的代码中导入它

我直接在我的网站/主机中编写代码,因为我不是处理本地服务器或 Visual Studio Code 反应方面的专家

var max = 1000000000000000000;
var dead = 5655521545895245645123154;

max = web3.utils.fromWei(max, 'ether');
dead = web3.utils.fromWei(dead, 'ether');

const total = max - dead;
document.getElementById('total ').innerHTML =total ;
<html lang="en">
<head>
  <meta charset="utf-8">
<title>Page Title</title>
 <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div >
    <div class="w3-display-middle">
      <span id="total"></span>
    </div>
</div>
</body>
</html>

【问题讨论】:

标签: javascript web3js


猜你喜欢
  • 2021-12-13
  • 2022-01-01
  • 2022-12-14
  • 1970-01-01
  • 2011-07-06
  • 2016-07-26
  • 2018-03-27
  • 2013-09-28
  • 1970-01-01
相关资源
最近更新 更多