Skip to content

Commit

Permalink
document the parse function
Browse files Browse the repository at this point in the history
  • Loading branch information
xxczaki committed Jan 20, 2020
1 parent ce2bf55 commit d47c212
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
- [to](#to)
- [base](#base-1)
- [rates](#rates-1)
- [parse(expression)](#parseexpression)
- [expression](#expression)
- [Migrating from money.js](#migrating-from-moneyjs)
- [Floating point issues](#floating-point-issues)
- [Related projects](#related-projects)
Expand Down Expand Up @@ -196,6 +198,24 @@ Type: `object`

Object containing currency rates (for example from an API, such as Open Exchange Rates)

### parse(expression)

Returns an `object`, which contains parsing results:

```
{
amount: number;
from: string | undefined;
to: string | undefined;
}
```

##### expression

Type: `string`

Expression you want to parse, ex. `10 usd to pln` or `€1.23 eur`

## Migrating from money.js

With `Cashify` constructor:
Expand Down

0 comments on commit d47c212

Please sign in to comment.