Skip to content

Instantly share code, notes, and snippets.

@boyzoid
Created February 28, 2019 15:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boyzoid/b712a31232ad8f033b503a745720d57c to your computer and use it in GitHub Desktop.
Save boyzoid/b712a31232ad8f033b503a745720d57c to your computer and use it in GitHub Desktop.
function calcAvg( numeric sold=0, numeric sales=0 ){
if( sales == 0 ){
return 0;
}
else{
return sold/sales;
}
}
data = {
avg = calcAvg,
sold = 50000,
sales = 25000
};
writeDump( data.avg( argumentCollection = data ) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment