I have requirement where I want sum values of all employee salaries in list
employeeList.foldLeft(java.math.BigDecimal.ZERO) { (accSal,emp) => accSal + getSalary(emp,designation,yearsOfExp) }
Here for each employee I want to call a function getSalary and sum the return values to get salaries of all employees
The above code does not seem to work for me , Keep getting error
Type mismatch expected:String actual:BigDecimal