Converts value into integer or returns 0 when conversion is not possible.
the value to convert.
integer value or 0 when conversion is not supported.
Converts value into integer or returns default value when conversion is not possible.
the value to convert.
the default value.
integer value or default when conversion is not supported.
Converts value into integer or returns null when conversion is not possible.
the value to convert.
integer value or null when conversion is not supported.
Generated using TypeDoc
Converts arbitrary values into integers using extended conversion rules:
Example
let value1 = IntegerConverter.toNullableInteger("ABC"); // Result: null let value2 = IntegerConverter.toNullableInteger("123.456"); // Result: 123 let value3 = IntegerConverter.toNullableInteger(true); // Result: 1 let value4 = IntegerConverter.toNullableInteger(new Date()); // Result: current milliseconds