Skip to content

Instantly share code, notes, and snippets.

@bennadel
Last active August 7, 2020 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennadel/572521d60260bb030256d1c2e15c3136 to your computer and use it in GitHub Desktop.
Save bennadel/572521d60260bb030256d1c2e15c3136 to your computer and use it in GitHub Desktop.
isNumeric() And numberFormat() Can Work With Very Large Numbers In Lucee CFML 5.3.6.61
true 10
true 100
true 1,000
true 10,000
true 100,000
true 1,000,000
true 10,000,000
true 100,000,000
true 1,000,000,000
true 10,000,000,000
true 100,000,000,000
true 1,000,000,000,000
true 10,000,000,000,000
true 100,000,000,000,000
true 1,000,000,000,000,000
true 10,000,000,000,000,000
true 100,000,000,000,000,000
true 1,000,000,000,000,000,000
true 10,000,000,000,000,000,000
true 100,000,000,000,000,000,000
true 1,000,000,000,000,000,000,000
true 10,000,000,000,000,000,000,000
true 99,999,999,999,999,990,000,000
true 1,000,000,000,000,000,000,000,000
true 9,999,999,999,999,999,000,000,000
true 99,999,999,999,999,990,000,000,000
true 999,999,999,999,999,900,000,000,000
true 10,000,000,000,000,000,000,000,000,000
true 100,000,000,000,000,000,000,000,000,000
true 999,999,999,999,999,900,000,000,000,000
true 9,999,999,999,999,999,000,000,000,000,000
true 99,999,999,999,999,990,000,000,000,000,000
true 1,000,000,000,000,000,000,000,000,000,000,000
true 10,000,000,000,000,000,000,000,000,000,000,000
true 100,000,000,000,000,000,000,000,000,000,000,000
true 999,999,999,999,999,900,000,000,000,000,000,000
true 9,999,999,999,999,998,000,000,000,000,000,000,000
true 99,999,999,999,999,980,000,000,000,000,000,000,000
true 999,999,999,999,999,800,000,000,000,000,000,000,000
true 9,999,999,999,999,998,000,000,000,000,000,000,000,000
true 99,999,999,999,999,980,000,000,000,000,000,000,000,000
true 999,999,999,999,999,900,000,000,000,000,000,000,000,000
true 9,999,999,999,999,999,000,000,000,000,000,000,000,000,000
true 99,999,999,999,999,990,000,000,000,000,000,000,000,000,000
true 1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
true 10,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
true 100,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
true 1,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000
true 10,000,000,000,000,001,000,000,000,000,000,000,000,000,000,000,000
<cfscript>
// Let's see how isNumeric() and numberFormat() work as we increase the
// order-of-magnitude to a large degree.
for ( i = 1 ; i < 50 ; i++ ) {
value = ( "1" & "0".repeatString( i ) );
echo( isNumeric( value ) );
echo( " " );
echo( numberFormat( value ) );
echo( "<br />" );
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment