Skip to content

Commit

Permalink
Updated README for new SUM function
Browse files Browse the repository at this point in the history
closes #145
  • Loading branch information
ndbroadbent authored and rubysolo committed Oct 21, 2017
1 parent 5c3ee1a commit f571996
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ calculator.evaluate!('10 * x')
Dentaku::UnboundVariableError: Dentaku::UnboundVariableError
```

Dentaku has built-in functions (including `if`, `not`, `min`, `max`, and
Dentaku has built-in functions (including `if`, `not`, `min`, `max`, `sum`, and
`round`) and the ability to define custom functions (see below). Functions
generally work like their counterparts in Excel:

```ruby
calculator.evaluate('SUM(1, 1, 2, 3, 5, 8)')
#=> 20

calculator.evaluate('if (pears < 10, 10, 20)', pears: 5)
#=> 10
calculator.evaluate('if (pears < 10, 10, 20)', pears: 15)
Expand Down Expand Up @@ -132,7 +135,7 @@ Comparison: `<`, `>`, `<=`, `>=`, `<>`, `!=`, `=`,

Logic: `IF`, `AND`, `OR`, `NOT`, `SWITCH`

Numeric: `MIN`, `MAX`, `ROUND`, `ROUNDDOWN`, `ROUNDUP`
Numeric: `MIN`, `MAX`, `SUM`, `ROUND`, `ROUNDDOWN`, `ROUNDUP`

Selections: `CASE` (syntax see [spec](https://github.com/rubysolo/dentaku/blob/master/spec/calculator_spec.rb#L292))

Expand Down

0 comments on commit f571996

Please sign in to comment.