Browse Source
Bugfix/fix currency conversion of ila to ils (#1026)
* Fix currency conversion: ILA to ILS
* Update changelog
pull/1027/head^2
Thomas Kaul
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
21 additions and
0 deletions
-
CHANGELOG.md
-
apps/api/src/services/data-provider/yahoo-finance/yahoo-finance.service.ts
|
|
@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. |
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
|
|
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
|
|
|
|
|
|
|
## Unreleased |
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
- Fixed an issue with the currency inconsistency in the _Yahoo Finance_ service (convert from `ILA` to `ILS`) |
|
|
|
|
|
|
|
## 1.161.1 - 16.06.2022 |
|
|
|
|
|
|
|
### Added |
|
|
|
|
|
@ -181,6 +181,9 @@ export class YahooFinanceService implements DataProviderInterface { |
|
|
|
if (symbol === 'USDGBp') { |
|
|
|
// Convert GPB to GBp (pence)
|
|
|
|
marketPrice = new Big(marketPrice).mul(100).toNumber(); |
|
|
|
} else if (symbol === 'USDILA') { |
|
|
|
// Convert ILS to ILA
|
|
|
|
marketPrice = new Big(marketPrice).mul(100).toNumber(); |
|
|
|
} |
|
|
|
|
|
|
|
response[symbol][format(historicalItem.date, DATE_FORMAT)] = { |
|
|
@ -243,6 +246,18 @@ export class YahooFinanceService implements DataProviderInterface { |
|
|
|
.mul(100) |
|
|
|
.toNumber() |
|
|
|
}; |
|
|
|
} else if ( |
|
|
|
symbol === 'USDILS' && |
|
|
|
yahooFinanceSymbols.includes('USDILA=X') |
|
|
|
) { |
|
|
|
// Convert ILS to ILA
|
|
|
|
response['USDILA'] = { |
|
|
|
...response[symbol], |
|
|
|
currency: 'ILA', |
|
|
|
marketPrice: new Big(response[symbol].marketPrice) |
|
|
|
.mul(100) |
|
|
|
.toNumber() |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|