From 17190d4b5f2456dc794f7eca3fdf1285fddcf527 Mon Sep 17 00:00:00 2001 From: t11s Date: Sat, 30 Jul 2022 01:34:02 -0700 Subject: [PATCH 1/2] docs: uint2str --- docs/built-in-functions.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index df96896309..cf197f67dc 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -442,6 +442,26 @@ Data Manipulation Returns a value of the type specified by ``type_``. For more details on available type conversions, see :ref:`type_conversions`. + +.. py:function:: uint2str(value: uint256) -> String + + Returns an unsigned integer's string representation. + + * ``value``: Unsigned integer to convert. + + Returns the string representation of ``value``. + + .. code-block:: python + + @external + @view + def foo(b: uint256) -> String[78]: + return uint2str(b) + + .. code-block:: python + + >>> ExampleContract.foo(420) + "420" .. py:function:: extract32(b: Bytes, start: uint256, output_type=bytes32) -> Any From 1e9176a33cee3b0afb4654b9082e096f83150a18 Mon Sep 17 00:00:00 2001 From: t11s Date: Sat, 30 Jul 2022 14:51:20 -0700 Subject: [PATCH 2/2] docs: change value type --- docs/built-in-functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/built-in-functions.rst b/docs/built-in-functions.rst index cf197f67dc..96360e817f 100644 --- a/docs/built-in-functions.rst +++ b/docs/built-in-functions.rst @@ -443,7 +443,7 @@ Data Manipulation For more details on available type conversions, see :ref:`type_conversions`. -.. py:function:: uint2str(value: uint256) -> String +.. py:function:: uint2str(value: unsigned integer) -> String Returns an unsigned integer's string representation.