Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
1153fd9a
Commit
1153fd9a
authored
Jun 06, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Douglas and Einstan
parent
a56f78af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
common.go
ethutil/common.go
+13
-7
No files found.
ethutil/common.go
View file @
1153fd9a
...
...
@@ -7,13 +7,15 @@ import (
// The different number of units
var
(
Ether
=
BigPow
(
10
,
18
)
Finney
=
BigPow
(
10
,
15
)
Szabo
=
BigPow
(
10
,
12
)
Shannon
=
BigPow
(
10
,
9
)
Babbage
=
BigPow
(
10
,
6
)
Ada
=
BigPow
(
10
,
3
)
Wei
=
big
.
NewInt
(
1
)
Douglas
=
BigPow
(
10
,
42
)
Einstein
=
BigPow
(
10
,
21
)
Ether
=
BigPow
(
10
,
18
)
Finney
=
BigPow
(
10
,
15
)
Szabo
=
BigPow
(
10
,
12
)
Shannon
=
BigPow
(
10
,
9
)
Babbage
=
BigPow
(
10
,
6
)
Ada
=
BigPow
(
10
,
3
)
Wei
=
big
.
NewInt
(
1
)
)
// Currency to string
...
...
@@ -21,6 +23,10 @@ var (
// Returns a string representing a human readable format
func
CurrencyToString
(
num
*
big
.
Int
)
string
{
switch
{
case
num
.
Cmp
(
Douglas
)
>=
0
:
return
fmt
.
Sprintf
(
"%v Douglas"
,
new
(
big
.
Int
)
.
Div
(
num
,
Douglas
))
case
num
.
Cmp
(
Einstein
)
>=
0
:
return
fmt
.
Sprintf
(
"%v Einstein"
,
new
(
big
.
Int
)
.
Div
(
num
,
Einstein
))
case
num
.
Cmp
(
Ether
)
>=
0
:
return
fmt
.
Sprintf
(
"%v Ether"
,
new
(
big
.
Int
)
.
Div
(
num
,
Ether
))
case
num
.
Cmp
(
Finney
)
>=
0
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment