Integer {\itshape number} primitive\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_integer_autotoc_md9949}{}\doxysection{$<$tt$>$integer/coerce$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_integer_autotoc_md9949}
Follows \href{finite.md\#finitecoerce}{\texttt{ {\ttfamily finite/coerce}}} additionally stripping decimal part from the number


\begin{DoxyCode}{0}
\DoxyCodeLine{const coerceToInteger = require("{}type/integer/coerce"{});}
\DoxyCodeLine{}
\DoxyCodeLine{coerceToInteger("{}12.95"{}); // 12}
\DoxyCodeLine{coerceToInteger(Infinity); // null}
\DoxyCodeLine{coerceToInteger(null); // null }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_integer_autotoc_md9950}{}\doxysection{$<$tt$>$integer/ensure$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_integer_autotoc_md9950}
If given argument is an integer coercible value (via \href{\#integercoerce}{\texttt{ {\ttfamily integer/coerce}}}) returns result number. Otherwise {\ttfamily Type\+Error} is thrown.


\begin{DoxyCode}{0}
\DoxyCodeLine{const ensureInteger = require("{}type/integer/ensure"{});}
\DoxyCodeLine{}
\DoxyCodeLine{ensureInteger(12.93); // "{}12"{}}
\DoxyCodeLine{ensureInteger(null); // Thrown TypeError: null is not an integer }

\end{DoxyCode}
 