我们在调用合约方法时,都可以传一些参数的,比如转账金额 value。

value 的单位是 wei,这是一个很小的单位,所以一般数值很大。

注意,把 ether 转 wei 需要先把 ether 的值转成字符串,不然就会报出标题中的错误。

比如 0.1 ether 转 wei 使用 web3.utils.toWei(this.inputEther.toString(), 'ether')。

反过来 wei 转 ether 使用 web3.utils.fromWei(xx, 'ether')

另外,这里有一个相关的错误,https://www.cnblogs.com/farwish/p/12424108.html

Refer:什么是Web3

Link:https://www.cnblogs.com/farwish/p/12424066.html

[FAQ] web3js, Error: Please pass numbers as strings or BN objects to avoid precision errors.的更多相关文章

  1. 异常-----freemarker.template.TemplateException: The only legal comparisons are between two numbers, two strings, or two dates

    1.错误描述 六月 26, 2014 10:44:49 下午 freemarker.log.JDK14LoggerFactory$JDK14Logger error 严重: Template proc ...

  2. The only legal comparisons are between two numbers, two strings, or two dates.

    The only legal comparisons are between two numbers, two strings, or two dates. Left  hand operand is ...

  3. PHP Fatal error: Cannot pass parameter 2 by reference

    PHP Fatal error:  Cannot pass parameter 2 by reference in 这个错误的意思是:不能按引用传递第2个参数 我的理解是: 方法的第2个参数 需要传递 ...

  4. phpcms切换到php7.2后无法修改文章提示Uncaught Error: [] operator not supported for strings

    前段时间将客户的phpcms站点升级到php7.2,相对比较顺利,但是今天他反应文章无法修改了,提示Uncaught Error: [] operator not supported for stri ...

  5. [Java Web]Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors

    手机客户端向服务器提交Http请求时,Tomcat抛出错误: 十二月 31, 2014 2:32:45 下午 org.apache.coyote.http11.AbstractHttp11Proces ...

  6. 信息: Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level

    四月 , :: 下午 org.apache.coyote.http11.AbstractHttp11Processor process 信息: Error parsing HTTP request h ...

  7. log4j报错ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

    ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only err ...

  8. [MyBatis]问题:ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

    错误信息 ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging onl ...

  9. leetcode@ [2/43] Add Two Numbers / Multiply Strings(大整数运算)

    https://leetcode.com/problems/multiply-strings/ Given two numbers represented as strings, return mul ...

  10. Numbers、Strings、Lists 笔记<一>

    下一篇:流程控制<二> 阅读链接:官方Python3.7教程 废话:最近开始阅读python3.7文档,希望把容易混淆的知识记下来. 除法总是返回一个浮点数 >>> 8/ ...

随机推荐

  1. 云端虚拟展示有多酷炫?3DCAT邀您来视博会现场体验!

    3DCAT实时渲染云将于2021年05月10日-12日,参展亚洲视觉智能与沉浸式产业博览会.在广交会4.2号展馆H31d展位,3DCAT将与大家分享云端虚拟展示领域最新的研究成果与创新应用案例,与全球 ...

  2. Locust 断言的实现?

    一.检查点的方式有哪些: 主要是python 内置的assert 断言(自动断言)还有locust 中的catch_response 断言(手动断言):那么这两者之间有什么区别呢? 其实主要区别在与生 ...

  3. 三维模型OBJ格式轻量化压缩在大规模场景的加载和渲染的作用分析

    三维模型OBJ格式轻量化压缩在大规模场景的加载和渲染的作用分析 OBJ格式是一种常用的三维模型文件格式,它存储了三维模型的几何信息和纹理坐标等相关属性.在大规模场景中加载和渲染三维模型时,OBJ格式的 ...

  4. Linux快速入门(六)Linux网络管理

    ping ping命令用于测试两台主机之间是否可以通信,一般情况下会使用ping www.baidu.com来测试网络连通性,如果不指定发送包的个数默认是一直发送数据包,可以使用Ctrl+C停止.网络 ...

  5. 记录--Vue自动生成组件名

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 unplugin-generate-component-name 一款用于以文件夹名或者setup标签写入名字来自动生成Vue组件名的插件 ...

  6. Elasticsearch内核解析 - 数据模型篇【转载】

    原文链接 Elasticsearch是一个实时的分布式搜索和分析引擎,它可以帮助我们用很快的速度去处理大规模数据,可以用于全文检索.结构化检索.推荐.分析以及统计聚合等多种场景. Elasticsea ...

  7. 【Java面试题】SpringMVC

    九.SpringMVC 63)SpringMVC 的流程 a.用户向服务器发送请求,请求被 SpringMVC 前端控制器 DispatchServlet 捕获: b.DispatcherServle ...

  8. C语言跨平台时间操作计算时间差

    头文件 #pragma once #if defined(_WIN32) #include<sys/timeb.h> #if defined(__UNIX__)||defined(__AP ...

  9. Rust 实现日志记录功能

    目录 log 日志库标准 简单示例 使用方法 库的开发者 应用开发者 日志库开发者 使用 log4rs 添加依赖 配置文件 运行项目 参考文章 log 日志库标准 log 是 Rust 的日志门面库, ...

  10. 13 JavaScript关于prototype(超重点)

    13 JavaScript关于prototype(超重点) prototype是js里面给类增加功能扩展的一种模式. 写个面向对象来看看. function People(name, age){ th ...