static const char* charmap = "0123456789";
std::string uint128ToString(const uint128_t& value)
{
std::string result;
result.reserve( 40 ); // max. 40 digits possible ( uint64_t has 20)
uint128_t helper = value;
do {
result += charmap[ helper % 10 ];
helper /= 10;
} while ( helper );
std::reverse( result.begin(), result.end() );
return result;
}
https://eosio.stackexchange.com/questions/2927/how-can-i-convert-a-uint128-t-to-a-string
版权属于:区块链中文技术社区 / 转载原创者
本文链接:https://bcskill.com/index.php/archives/821.html
相关技术文章仅限于相关区块链底层技术研究,禁止用于非法用途,后果自负!本站严格遵守一切相关法律政策!