Natural {\itshape number} primitive\hypertarget{md_sfcode_node_modules_ext_node_modules_type_docs_natural_number_autotoc_md9957}{}\doxysection{$<$tt$>$natural-\/number/coerce$<$/tt$>$}\label{md_sfcode_node_modules_ext_node_modules_type_docs_natural_number_autotoc_md9957}
Follows \href{integer.md\#integercoerce}{\texttt{ {\ttfamily integer/coerce}}} but returns {\ttfamily null} for values below {\ttfamily 0}


\begin{DoxyCode}{0}
\DoxyCodeLine{const coerceToNaturalNumber = require("{}type/natural-\/number/coerce"{});}
\DoxyCodeLine{}
\DoxyCodeLine{coerceToNaturalNumber("{}12.95"{}); // 12}
\DoxyCodeLine{coerceToNaturalNumber(-\/120); // null}
\DoxyCodeLine{coerceToNaturalNumber(null); // null }

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


\begin{DoxyCode}{0}
\DoxyCodeLine{const ensureNaturalNumber = require("{}type/natural-\/number/ensure"{});}
\DoxyCodeLine{}
\DoxyCodeLine{ensureNaturalNumber(12.93); // "{}12"{}}
\DoxyCodeLine{ensureNaturalNumber(-\/230); // Thrown TypeError: null is not a natural number }

\end{DoxyCode}
 