Ether Binder
Set of utilities for interacting with Ethereum and it's smart contracts with PHP, with generating ABI bindings and Ethereum-related types
Loading...
Searching...
No Matches
M8B\EtherBinder\Utils\WeiFormatter Class Reference

Static Public Member Functions

static fromHuman (float|int|string|OOGmp $human, int|string|EtherFormats $format=EtherFormats::ETHER)
 
static fromWei (int|string|OOGmp $wei, int $finalDecimals, int|string|EtherFormats $format=EtherFormats::ETHER)
 

Detailed Description

WeiFormatter class for parsing back and forth human-readable format with specific denominations of ether, most commonly used for WEI.

Author
DubbaThony

Member Function Documentation

◆ fromHuman()

static M8B\EtherBinder\Utils\WeiFormatter::fromHuman ( float|int|string|OOGmp $human,
int|string|EtherFormats $format = EtherFormats::ETHER )
static

Converts a value from human format.

Parameters
float | int | string | OOGmp$humanThe input human value.
int | string | EtherFormats$formatThe input format.
Returns
OOGmp The value in Wei.

◆ fromWei()

static M8B\EtherBinder\Utils\WeiFormatter::fromWei ( int|string|OOGmp $wei,
int $finalDecimals,
int|string|EtherFormats $format = EtherFormats::ETHER )
static

Converts Wei to another format.

Parameters
int | string | OOGmp$weiThe input value in Wei.
int$finalDecimalsThe final decimal places to keep.
int | string | EtherFormats$formatThe output format.
Returns
string The converted value.

The documentation for this class was generated from the following file: