Created
July 15, 2025 12:04
-
-
Save trycf/4821230c2aab13f8618717aa2f83da1a to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
stats = createObject("java", "java.util.DoubleSummaryStatistics").init(); | |
numbers = [9.5,20,25,30.5]; | |
for (n in numbers) { | |
stats.accept(javaCast("double", n)); | |
} | |
</cfscript> | |
<cfoutput> | |
Avg: #stats.getAverage()#<br> | |
Min: #stats.getMin()#<br> | |
Max: #stats.getMax()#<br> | |
Sum: #stats.getSum()#<br> | |
Count: #stats.getCount()# | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment