diff options
author | chriseth <chris@ethereum.org> | 2018-02-13 04:57:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-13 04:57:05 +0800 |
commit | bf3682108048fd8646c0388f12ac0647df3099a3 (patch) | |
tree | fcb482a122ceac176faa6b628710033da513d7bb /libdevcore/CommonData.h | |
parent | 69e2f497ba293c9b821dcad01eeb226446e18683 (diff) | |
parent | d7e5cc3f9706ef55414c19abeac63e58bf5a1137 (diff) | |
download | dexon-solidity-bf3682108048fd8646c0388f12ac0647df3099a3.tar dexon-solidity-bf3682108048fd8646c0388f12ac0647df3099a3.tar.gz dexon-solidity-bf3682108048fd8646c0388f12ac0647df3099a3.tar.bz2 dexon-solidity-bf3682108048fd8646c0388f12ac0647df3099a3.tar.lz dexon-solidity-bf3682108048fd8646c0388f12ac0647df3099a3.tar.xz dexon-solidity-bf3682108048fd8646c0388f12ac0647df3099a3.tar.zst dexon-solidity-bf3682108048fd8646c0388f12ac0647df3099a3.zip |
Merge pull request #3478 from ethereum/simplifierFormatNumber
Format number nicely in the IULIA simplifier.
Diffstat (limited to 'libdevcore/CommonData.h')
-rw-r--r-- | libdevcore/CommonData.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index b85abe95..e410af5c 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -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; |