package ethutil import ( "fmt" "math/big" "runtime" ) func IsWindows() bool { return runtime.GOOS == "windows" } func WindonizePath(path string) string { if string(path[0]) == "/" && IsWindows() { path = path[1:] } return path } // The different number of units var ( 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 // Returns a string representing a human readable format func CurrencyToString(num *big.Int) string { var ( fin *big.Int = num denom string = "Wei" ) switch { case num.Cmp(Douglas) >= 0: fin = new(big.Int).Div(num, Douglas) denom = "Douglas" case num.Cmp(Einstein) >= 0: fin = new(big.Int).Div(num, Einstein) denom = "Einstein" case num.Cmp(Ether) >= 0: fin = new(big.Int).Div(num, Ether) denom = "Ether" case num.Cmp(Finney) >= 0: fin = new(big.Int).Div(num, Finney) denom = "Finney" case num.Cmp(Szabo) >= 0: fin = new(big.Int).Div(num, Szabo) denom = "Szabo" case num.Cmp(Shannon) >= 0: fin = new(big.Int).Div(num, Shannon) denom = "Shannon" case num.Cmp(Babbage) >= 0: fin = new(big.Int).Div(num, Babbage) denom = "Babbage" case num.Cmp(Ada) >= 0: fin = new(big.Int).Div(num, Ada) denom = "Ada" } // TODO add comment clarifying expected behavior if len(fin.String()) > 5 { return fmt.Sprintf("%sE%d %s", fin.String()[0:5], len(fin.String())-5, denom) } return fmt.Sprintf("%v %s", fin, denom) } // Common big integers often used var ( Big1 = big.NewInt(1) Big2 = big.NewInt(2) Big3 = big.NewInt(3) Big0 = big.NewInt(0) BigTrue = Big1 BigFalse = Big0 Big32 = big.NewInt(32) Big256 = big.NewInt(0xff) Big257 = big.NewInt(257) ) e='dependabot/npm_and_yarn/devel/electron4/files/ini-1.3.7'>dependabot/npm_and_yarn/devel/electron4/files/ini-1.3.7 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/www
Commit message (Expand)AuthorAgeFilesLines
* Fix a bogus BUILD_DEPENDS entry that was breaking make index.knu2003-02-211-1/+1
* Fix a bug where Galeon would not launch helper apps after files weremarcus2003-02-212-0/+28
* - retire pkg-commentdinoex2003-02-211-1/+0
* - Add COMMENTdinoex2003-02-211-0/+1
* - retire pkg-commentdinoex2003-02-212-2/+0
* Add mplayerplug-in, a Mozilla plugin that uses MPlayer to play videos onmarcus2003-02-216-0/+49
* Allow overriding MAINTAINER and COMMENT.knu2003-02-211-2/+2
* Add MAINTAINER=ports@FreeBSD.org and de-pkg-comment.knu2003-02-212-2/+2
* De-pkg-comment.knu2003-02-21206-103/+103
* * Re-add libgnomeprint[ui]-2.0 support and unbreakmarcus2003-02-214-6/+4
* - add COMMENTdinoex2003-02-212-0/+2
* Conditionalise several dependencies on PERL_LEVEL to make those ports moresobomax2003-02-212-12/+22
* Don't even try to sense Berkeley DB2/DB3 (from /usr/local), itache2003-02-202-1/+32
* Add swiggle, A commandline tool to genereate a "Web Gallery"arved2003-02-206-0/+78
* Remove pkg-comment files in my ports.roam2003-02-204-2/+2
* used the wrong version of ports for the MAINTAINERjeh2003-02-191-1/+1
* Update to 1.0.5.knu2003-02-193-4/+10
* Correct MAN3 and pkg-plist.nork2003-02-192-3/+6
* Fix CFLAGS for apxsache2003-02-191-3/+3
* - upgrading tidy to 030217;leeym2003-02-194-9/+24
* Update to 0.9.marcus2003-02-194-12/+33
* update MASTER_SITESleeym2003-02-182-6/+2
* De-pkg-comment my non-ruby ports as well.knu2003-02-182-1/+1
* De-pkg-comment.knu2003-02-1820-10/+10
* Remove the renaming of Xft headers and library from the Xft (Xft2) port.anholt2003-02-1815-104/+15
* Add a conditional dependency on nautilus.marcus2003-02-181-1/+9
* Chase pth's shared lib version.marcus2003-02-182-2/+2
* Update to 1.3.2. Note, galeon2 now requires mozilla-devel-gtk2. Youmarcus2003-02-1711-227/+38
* Add WITHOUT_APACHE_EXPAT knob to build with no expat at all for those whoache2003-02-171-8/+19
* Update to 1.2.8.marcus2003-02-175-92/+18
* Update to 0.11.jeh2003-02-162-4/+4
* Update to 030208.markp2003-02-163-14/+9
* Stop abusing OPTIM for anything, use CFLAGS instead, as recommended byache2003-02-162-9/+13
* Correct the dependency so INDEX builds.will2003-02-161-1/+1
* Update to adzap-20030212kris2003-02-162-2/+2
* update to horde-2.2.1leeym2003-02-166-7/+36
* Update to 7.2.naddy2003-02-157-38/+14
* Update to 1.2.1.markp2003-02-143-18/+13
* [recommit]nork2003-02-147-254/+331
* Add mod_perl2 1.99r08, embeds a Perl interpreter in thenork2003-02-141-0/+1
* Fix the ${MASTER_SITE_LOCAL} group so that it correctly makes use ofmarcus2003-02-145-5/+5
* Fix build with mozilla-devel-gtk2.marcus2003-02-146-5/+194
* Fix calendar build.marcus2003-02-143-0/+33
* Update to 0.1.1.knu2003-02-143-3/+8
* Use MASTER_SITE_APACHE*.naddy2003-02-134-33/+8
* Fix BUILD_DEPENDS to p5-Test-Simple(implicitly).nork2003-02-131-2/+3
* - remove URLdinoex2003-02-13