castToFloat
Typecast variable to float
import { castToFloat } from "@corefunc/corefunc/cast/to/float";
castToFloat("16.5"); // => 16.5
castToFloatOrNull
Typecast variable to float or null if failed
import { castToFloatOrNull } from "@corefunc/corefunc/cast/to/float-or-null";
castToFloatOrNull("16.5"); // => 16.5
castToInt
Typecast variable to integer.
Any number.
castToIntOrNan
Typecast variable to integer or NaN if failed.
import { castToIntOrNan } from "@corefunc/corefunc/cast/to/int-or-nan";
castToIntOrNan("16.5"); // => 16
0.3.21
castToIntOrNull
Typecast variable to integer or null if failed.
import { castToIntOrNull } from "@corefunc/corefunc/cast/to/int-or-null";
castToIntOrNull("16.5"); // => 16
castToPercentOrNull
import { castToPercentOrNull } from "@corefunc/corefunc/cast/to/percent-or-null";
castToPercentOrNull("16.501"); // => 16.50
castToString
Cast any value to string.
castToString(undefined) ➜ ""
castToString(-0) ➜ "-0"
Value to transform
Value transformed into string
Creates a new Array instance from an array-like or iterable object This has different behaviour from Array.from.
Array.from
Generated using TypeDoc
castToFloat
Typecast variable to float
import { castToFloat } from "@corefunc/corefunc/cast/to/float";
castToFloat("16.5"); // => 16.5