Skip to content

Commit

Permalink
docs(readme): default forex service
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Nov 19, 2016
1 parent c9e8b51 commit 734f36e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@ A default locale and localeOptions is set with `Money.defaultLocale` and `Money.

### Currency conversion

`to(currency)` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) to convert the Money into another currency. It uses `Money.forexService` to determine the exchange rate. If the exchange rate cannot be determined, then the Promise is rejected.
`to(currency)` returns a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) to convert the Money into another currency. It uses `Money.forexService` to determine the exchange rate. If the exchange rate cannot be determined, then the Promise is rejected. The conversion does not round the result.

The default `forexService` uses the exchange rates from European Central Bank via the [fixer.io API](http://fixer.io).

new Money('100 NZD')
.to('JPY')
.then(console.log) // 7758.9 JPY

### Browser usage

Expand Down

0 comments on commit 734f36e

Please sign in to comment.