IsNumeric() is inconsistent with NumberFormat() in Scientific Notation numbers

Description

IsNumeric() and NumberFormat() are inconsistent when it comes to Scientific Notation numbers. The following expressions throws an error:

if (isNumeric("39E48756")) echo(numberFormat("39E48756", ","));
invalid call of the function numberFormat, first Argument (number) is invalid, can't cast value [39E48756] to a number

Also, ACF interprets scientific notation numbers differently from Lucee when the exponent value is large. Consider the following snippet:

Expression

Lucee

ACF

isNumeric("39E48756")

true

false

isNumeric("39E4875")

true

false

isNumeric("39E487")

true

false

isNumeric("39E48")

true

true

isNumeric("39E4")

true

true

writeDump(isNumeric("39E48756")); writeDump(isNumeric("39E4875")); writeDump(isNumeric("39E487")); writeDump(isNumeric("39E48")); writeDump(isNumeric("39E4"));

Environment

None

Activity

Show:

Michael Offner 30 January 2017 at 08:24

Estimate: 2h

Fixed

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Created 27 January 2017 at 17:39
Updated 2 January 2018 at 20:55
Resolved 31 October 2017 at 05:07

Flag notifications