mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 05:06:43 +00:00
Merge 13a28b18fe into b2b9b3b567
This commit is contained in:
commit
51052c52f5
2 changed files with 114 additions and 82 deletions
File diff suppressed because one or more lines are too long
|
|
@ -768,11 +768,18 @@ var BigNumber = require('bignumber.js');
|
|||
|
||||
var ETH_UNITS = [
|
||||
'wei',
|
||||
'Kwei',
|
||||
'kwei',
|
||||
'Mwei',
|
||||
'Gwei',
|
||||
'szabo',
|
||||
'finney',
|
||||
'femtoether',
|
||||
'picoether',
|
||||
'nanoether',
|
||||
'microether',
|
||||
'miliether',
|
||||
'micro',
|
||||
'mili',
|
||||
'ether',
|
||||
'grand',
|
||||
'Mether',
|
||||
|
|
@ -873,12 +880,19 @@ var unitMap = {
|
|||
'wei': '1',
|
||||
'kwei': '1000',
|
||||
'ada': '1000',
|
||||
'femtoether': '1000',
|
||||
'mwei': '1000000',
|
||||
'babbage': '1000000',
|
||||
'picoether': '1000000',
|
||||
'gwei': '1000000000',
|
||||
'shannon': '1000000000',
|
||||
'nanoether': '1000000000',
|
||||
'szabo': '1000000000000',
|
||||
'microether': '1000000000000',
|
||||
'micro': '1000000000000',
|
||||
'finney': '1000000000000000',
|
||||
'miliether': '1000000000000000',
|
||||
'mili': '1000000000000000',
|
||||
'ether': '1000000000000000000',
|
||||
'kether': '1000000000000000000000',
|
||||
'grand': '1000000000000000000000',
|
||||
|
|
@ -1073,13 +1087,14 @@ var getValueOfUnit = function (unit) {
|
|||
* Takes a number of wei and converts it to any other ether unit.
|
||||
*
|
||||
* Possible units are:
|
||||
* - kwei/ada
|
||||
* - mwei/babbage
|
||||
* - gwei/shannon
|
||||
* - szabo
|
||||
* - finney
|
||||
* - ether
|
||||
* - kether/grand/einstein
|
||||
* SI Short SI Full Effigy Other
|
||||
* - kwei femtoether ada
|
||||
* - mwei picoether babbage
|
||||
* - gwei nanoether shannon
|
||||
* - -- microether szabo micro
|
||||
* - -- miliether finney mili
|
||||
* - ether -- --
|
||||
* - kether einstein grand
|
||||
* - mether
|
||||
* - gether
|
||||
* - tether
|
||||
|
|
@ -1099,13 +1114,14 @@ var fromWei = function(number, unit) {
|
|||
* Takes a number of a unit and converts it to wei.
|
||||
*
|
||||
* Possible units are:
|
||||
* - kwei/ada
|
||||
* - mwei/babbage
|
||||
* - gwei/shannon
|
||||
* - szabo
|
||||
* - finney
|
||||
* - ether
|
||||
* - kether/grand/einstein
|
||||
* SI Short SI Full Effigy Other
|
||||
* - kwei femtoether ada
|
||||
* - mwei picoether babbage
|
||||
* - gwei nanoether shannon
|
||||
* - -- microether szabo micro
|
||||
* - -- miliether finney mili
|
||||
* - ether -- --
|
||||
* - kether einstein grand
|
||||
* - mether
|
||||
* - gether
|
||||
* - tether
|
||||
|
|
|
|||
Loading…
Reference in a new issue