I am currently developing a function that converts a list of values to integers. In the case of float types, we have the convenient float8in_internal_null()
function at toFloatList()
, which returns the appropriate float value if the conversion is successful, but returns NULL if the conversion of a list element fails.
However, when working with integers and using the atoi()
function, I encountered a limitation. Unlike float8in_internal_null()
, atoi()
does not return NULL when it fails to convert an element of the list to an integer. Instead, it returns 0.
Is there an alternative function within some library in AGE, that can help me achieve the desired behavior of returning NULL when a conversion to an integer is not possible? I would appreciate any guidance on this matter.