Generic pretty-printed numbers..

This commit is contained in:
chriseth 2018-02-09 18:56:40 +01:00
parent 2095e7a32d
commit d84c9e148b

View File

@ -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;