Difference between revisions of "Sum"

From Catglobe Wiki
Jump to: navigation, search
(jrfconvert import)
 
(jrfconvert import)
Line 4: Line 4:
 
====sum====
 
====sum====
  
Returns the sum of all row values for a column.
+
Gets the sum of a set of expressions. The values of all parameters must be convertible to numbers.
  
 
'''Syntax'''
 
'''Syntax'''
  
sum(''columnName'')
+
sum(''exp1, exp2, exp3, '')
  
 
'''Arguments'''
 
'''Arguments'''
  
''columnName'': Is the name of a column in the data table.
+
''exp''i: Is an expression of any type
  
 
'''Return type'''
 
'''Return type'''
Line 20: Line 20:
 
'''Examples'''
 
'''Examples'''
  
//calculate the sum of ClassBudget, class 1 has
+
number a = sum(1, 2, "3", 4 + 1, 5);
  
number s = sum(ClassBudget) where (ClassId == 1);
+
print(a);
 +
 
 +
//a = 16
  
 
'''Availability'''
 
'''Availability'''
Line 28: Line 30:
 
Version 4.8
 
Version 4.8
 
__NOTOC__
 
__NOTOC__
<!-- imported from file: 767.htm-->
+
<!-- imported from file: 571.htm-->

Revision as of 11:06, 7 March 2011



sum

Gets the sum of a set of expressions. The values of all parameters must be convertible to numbers.

Syntax

sum(exp1, exp2, exp3, …)

Arguments

expi: Is an expression of any type

Return type

number

Examples

number a = sum(1, 2, "3", 4 + 1, 5);

print(a);

//a = 16

Availability

Version 4.8