mbezhanov/ethereum-converter
A simple library for performing conversion between various Ethereum units
Maintainers
v2.0.0
2021-03-12 07:23 UTC
Requires
- php: ^7.3|^8.0
Requires (Dev)
- phpunit/phpunit: ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT a259de3486dcbe72261f579e1f43972ca06b0823
- Marin Bezhanov <marin.bezhanov.woop@gmail.com>
This package is auto-updated.
Last update: 2026-06-27 23:37:01 UTC
README
A simple library for performing easy conversion between various Ethereum units.
The conversion logic has been modelled after web3.js
This library requires the bcmath PHP extension.
Installation:
composer require mbezhanov/ethereum-converter
Usage:
$converter = new Bezhanov\Ethereum\Converter(); // convert from Wei to another unit: $value = $converter->fromWei('21000000000000', 'finney'); echo $value; // "0.021" // convert from another unit to Wei: $value = $converter->toWei('1', 'ether'); echo $value; // "1000000000000000000"
Supported units:
kwei/adamwei/babbagegwei/shannonszabofinneyetherkether/grand/einsteinmethergethertether
