Type conversion: String to number

The programming language Chora provides the data type string intended to represent text. On the other hand, Chora supports different data types to represent numerical operands. We distinguish between signed and unsigned integer data types and the floating-point data type.

In order to allow you to process string operands containing numbers as text, Chora provides a set of instant parse methods you can simply apply in context of the string. The methods evaluate the text in the string, verify whether the text does contain a valid number and decode the number. Finally, the corresponding value is returned. Following parse instant methods are available:

Instant method name

Short description

parse_int32()

Converts an integral number stored in the string into an int32 value.

parse_uint32()

Converts an integral number stored in the string into a uint32 value.

parse_float()

Converts a number stored in the string into a float value.