UNPKG

@zeix/ui-element

Version:

UIElement - a HTML-first library for reactive Web Components

34 lines (17 loc) 649 B
[**@zeix/ui-element**](../README.md) *** [@zeix/ui-element](../globals.md) / asInteger # Function: asInteger() > **asInteger**(`fallback?`): [`AttributeParser`](../type-aliases/AttributeParser.md)\<`number`\> Defined in: [src/lib/parsers.ts:37](https://github.com/zeixcom/ui-element/blob/297c0e8e040b3880ad85a2bc873523a8086f09a3/src/lib/parsers.ts#L37) Parse an attribute as as number forced to integer with a fallback Supports hexadecimal and scientific notation ## Parameters ### fallback? `number` = `0` fallback value ## Returns [`AttributeParser`](../type-aliases/AttributeParser.md)\<`number`\> parser function ## Since 0.11.0