MCPcopy Index your code
hub / github.com/angular/angular / toInteger

Function toInteger

packages/forms/src/directives/validators.ts:40–42  ·  view source on GitHub ↗

* Method that updates string to integer if not already a number * * @param value The value to convert to integer. * @returns value of parameter converted to number or integer.

(value: string | number)

Source from the content-addressed store, hash-verified

38 * @returns value of parameter converted to number or integer.
39 */
40function toInteger(value: string | number): number {
41 return typeof value === 'number' ? value : parseInt(value, 10);
42}
43
44/**
45 * Method that ensures that provided value is a float (and converts it to float if needed).

Callers 2

MinLengthValidatorClass · 0.85
MaxLengthValidatorClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…