Eban numbers: Difference between revisions

Line 1,112:
 
' -> !OUT::write
</lang>
 
Alternatively, if regex is not your thing, we can do it numerically, which actually runs faster
<lang tailspin>
templates isEban
def number: $it;
$it -> (<1..> $it!) -> #
<0> $number !
<?($it mod 1000 <0|2|4|6|30..66?($it mod 10 <0|2|4|6>)>)> $it / 1000 -> #
end isEban
// Same calling code as above
</lang>
{{out}}
Anonymous user