Skip to main content

String to Number

Module Info:

moduleType: "internal",
moduleName: "stringToNumber"

Description

The stringToNumber function receives a numeric string and atempts to convert it to its numeric value.

Inputs

NameTypeRequired
stringstring

Outputs

NameType
resultnumber
errorMessagestring

errorMessage will only be deefined if the given string cannot be converted to a number.

Examples

Inputs Outputs
string result errorMessage
"73" 73 undefined
"44.2" 44.2 undefined
"seventeen" undefined "Given string is not convertible to a number"