We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
on version 0.8, the function for conversion uint -> string is not working.
update potential: function uint2str(uint _i) internal pure returns (string memory str) { if (_i == 0){ return "0"; } uint256 j = _i; uint256 length; while (j != 0){ length++; j /= 10; } bytes memory bstr = new bytes(length); uint256 k = length; j = _i; while (j != 0) { bstr[--k] = bytes1(uint8(48 + j % 10)); j /= 10; } str = string(bstr); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
on version 0.8, the function for conversion uint -> string is not working.
update potential:
function uint2str(uint _i) internal pure returns (string memory str) {
if (_i == 0){
return "0";
}
uint256 j = _i;
uint256 length;
while (j != 0){
length++;
j /= 10;
}
bytes memory bstr = new bytes(length);
uint256 k = length;
j = _i;
while (j != 0)
{
bstr[--k] = bytes1(uint8(48 + j % 10));
j /= 10;
}
str = string(bstr);
}
The text was updated successfully, but these errors were encountered: