Skip to content

Instantly share code, notes, and snippets.

@mgryszko
Created February 6, 2021 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgryszko/fd1a34ef831f138f4733572b5bfe70d4 to your computer and use it in GitHub Desktop.
Save mgryszko/fd1a34ef831f138f4733572b5bfe70d4 to your computer and use it in GitHub Desktop.
def total(pricings: List[Pricing]): BigDecimal =
pricings.foldLeft(BigDecimal(0)) { (grandTotal, pricing) =>
grandTotal + total(pricing)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment