toNumber

Modified on Tue, 22 Aug 2023

Description

Use this function to convert a value to a number.

Syntax

toNumber(value)

Returns

Return ValueDescription
NumberReturns the converted value as a number

Sample

ExampleResultDescription
toNumber("42")42Returns the converted string value "42" as the number 42.

To view all the Math and Number functions, click here.