mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Generic pretty-printed numbers..
This commit is contained in:
parent
2095e7a32d
commit
d84c9e148b
@ -155,6 +155,14 @@ inline std::string formatNumber(bigint const& _value)
|
||||
return _value.str();
|
||||
}
|
||||
|
||||
inline std::string formatNumber(u256 const& _value)
|
||||
{
|
||||
if (_value > 0x1000000)
|
||||
return toHex(toCompactBigEndian(_value), 2, HexPrefix::Add);
|
||||
else
|
||||
return _value.str();
|
||||
}
|
||||
|
||||
inline std::string toCompactHexWithPrefix(u256 val)
|
||||
{
|
||||
std::ostringstream ret;
|
||||
|
Loading…
Reference in New Issue
Block a user