% This file is embedded in datatool-user.pdf version 3.4.1 2025-04-25
% Example 30 Conditionals (lua)
% Label: "ex:luaif"
% arara: lualatex
% arara: pdfcrop
\documentclass[12pt]{article}
\pagestyle{empty}
\usepackage[math=lua]{datatool-base}
\newcommand{\numducks}{4} 
\begin{document}
\edef\test{There
 \dtlifnumeq{\numducks}{1}{is 1 duck}{are \numducks\space ducks}.}
\texttt{\meaning\test} 

Test text: \test 

\edef\test{There are
 \dtlifnumlt{\numducks}{10}{less than}{not less than}
 10 ducks.} \texttt{\meaning\test} 

Test text: \test 

\edef\test{There are
 \dtlifnumgt{\numducks}{10}{more than}{not more than}
 10 ducks.} \texttt{\meaning\test} 

Test text: \test 

\edef\test{There 
 \dtlifnumopenbetween{\numducks}{4}{10}{are}{are not}
 between 4 and 10 ducks (exclusive).} \texttt{\meaning\test} 

Test text: \test 

\edef\test{There 
 \dtlifnumclosedbetween{\numducks}{4}{10}{are}{are not}
 between 4 and 10 ducks (inclusive).} \texttt{\meaning\test} 

Test text: \test 
\end{document}
