toSafeInteger

Modified on Tue, 22 Aug 2023

Description

Use this function to convert a value to a safe integer. A safe integer can be compared and represented correctly.

Syntax

toSafeInteger(value)

Returns

Return ValueDescription
NumberReturns the converted value as a safe integer

Sample

ExampleResultDescription
toSafeInteger("42.5")42Returns the converted floating-point value "42.5" as the safe integer 42.

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