BigNumberFormatter

This commit is contained in:
sc0Vu 2018-01-11 13:01:06 +08:00
parent 6c4e422bfd
commit 2340db233b

View File

@ -0,0 +1,33 @@
<?php
/**
* This file is part of web3.php package.
*
* (c) Kuan-Cheng,Lai <alk03073135@gmail.com>
*
* @author Peter Lai <alk03073135@gmail.com>
* @license MIT
*/
namespace Web3\Formatters;
use InvalidArgumentException;
use Web3\Utils;
use Web3\Formatters\IFormatter;
class BigNumberFormatter implements IFormatter
{
/**
* format
*
* @param mixed $value
* @return string
*/
public static function format($value)
{
$value = Utils::toString($value);
$bn = Utils::toBn($value);
return $bn;
}
}