Skip to content

Type

Type module

Sources

Items from Type can be imported/included and used via following ways.

/**
* Import via main package
* Access items like: am5.type.myVariable
*/
import * as am5 from "@amcharts/amcharts5";
/**
* Import via: Type.ts
* Access items like: $type.myVariable
*/
import * as $type from "@amcharts/amcharts5/Type";

Variables

Type does not have any variables.

Functions

isArray(value: any)

Returns value

Checks if parameter is Array.

isDate(value: any)

Returns value

Checks if parameter is Date.

isNaN(value: number)

Returns boolean

Returns true if value is not a number (NaN).

isNumber(value: any)

Returns value

Checks if parameter is number. NaN is not counted as one.

isObject(value: any)

Returns value

Checks if parameter is object.

isString(value: any)

Returns value

Checks if parameter is string.

numberToString(value: number)

Returns string

Converts numeric value into string. Deals with large or small numbers that would otherwise use exponents.

toDate(value: Date | number | string)

Returns Date

Converts anything to Date object.

toNumber(value: any)

Returns number

Converts any value into a number. A string with digits in it loses its other characters first, so "$1,200" becomes 1200. null and undefined are returned as they are.