func Sum(first Decimal, rest ...Decimal) Decimal {
	varsList := make([]string, 1+len(rest))
	varsList[0] = first.vars
	formulaList := make([]string, 1+len(rest))
	formulaList[0] = first.formula

	newRest := make([]decimal.Decimal, len(rest))
	for i, r := range rest {
		newRest[i] = r.decimal
		varsList[i+1] = r.vars
		formulaList[i+1] = r.formula
	}

	return Decimal{
		decimal: decimal.Sum(first.decimal, newRest...),
		vars:    sum + leftParen + strings.Join(varsList, comma) + rightParen,
		formula: sum + leftParen + strings.Join(formulaList, comma) + rightParen,
	}
}
// Sum returns the combined total of the provided first and rest Decimals
Sum returns the combined total of the provided first and rest Decimals
// Sum returns the combined total of the provided first and rest Decimals
func Sum(first Decimal, rest ...Decimal) Decimal {
	varsList := make([]string, 1+len(rest))
	varsList[0] = first.vars
	formulaList := make([]string, 1+len(rest))
	formulaList[0] = first.formula
	newRest := make([]decimal.Decimal, len(rest))
	for i, r := range rest {
		newRest[i] = r.decimal
		varsList[i+1] = r.vars
		formulaList[i+1] = r.formula
	}
	return Decimal{
		decimal: decimal.Sum(first.decimal, newRest...),
		vars:    sum + leftParen + strings.Join(varsList, comma) + rightParen,
		formula: sum + leftParen + strings.Join(formulaList, comma) + rightParen,
	}
}
func Sum ( first Decimal , rest ... Decimal ) Decimal { varsList := make ( [ ] string , 1 + len ( rest ) ) varsList [ 0 ] = first . vars formulaList := make ( [ ] string , 1 + len ( rest ) ) formulaList [ 0 ] = first . formula newRest := make ( [ ] decimal . Decimal , len ( rest ) ) for i , r := range rest { newRest [ i ] = r . decimal varsList [ i + 1 ] = r . vars formulaList [ i + 1 ] = r . formula } return Decimal { decimal : decimal . Sum ( first . decimal , newRest ... ) , vars : sum + leftParen + strings . Join ( varsList , comma ) + rightParen , formula : sum + leftParen + strings . Join ( formulaList , comma ) + rightParen , } }
Sum returns the combined total of the provided first and rest Decimals
Sum returns the combined total of the provided first and rest Decimals