Skip to content

toInt

toInt(value, fallback): number

Defined in: core/utils/options.ts:16

Reads a whole number out of a setting that can be a number or a string (from a data-* attribute).

unknown

The setting.

number

What to use when value is not a number.

number

toInt('300', 150); // 300
toInt('wide', 150); // 150