"." equal to "0"?

In Lucee, a string containing a single period is treated as a numeric string with the value zero. In particular “.” EQ “0” evaluates as true, which appears to be a change from Lucee 5.3.x.

Based on the online tester, this is not the case in Lucee 4.5.x or Lucee 6 either. It is not the case in ACF, at least not ACF 11.

(Note: You can also write out a period as a numeric literal in source code, although that is more like a quirk than a problem, e.g. #5 + . + 7# yields “12”)

Anyway the “0” EQ “.” thing in 5.4.x is rather inconvenient. We worked around it by using Compare instead.

We were parsing numeric strings to adjust the number of decimal places and code that has worked for quite some time now started to fail when we upgraded from 5.3.9.X to

Tomcat 9.0.46
OpenJDK 11
RHEL 8.8