Add toStringSigned to Strings.sol (#4330)

Co-authored-by: Francisco <fg@frang.io>
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
Balaji Shetty Pachai
2023-06-20 05:26:00 +05:30
committed by GitHub
parent fc19a7947c
commit 1f4e33fb72
3 changed files with 10 additions and 5 deletions

View File

@ -46,7 +46,7 @@ library Strings {
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}