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:
committed by
GitHub
parent
fc19a7947c
commit
1f4e33fb72
@ -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)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user