Browse Source
Bugfix/fix issue in annualized performance calculation (#6310)
* Fix issue in annualized performance calculation: Handle case where growthFactor is Infinity
* Update changelog
pull/6311/head^2
Thomas Kaul
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
6 additions and
2 deletions
-
CHANGELOG.md
-
libs/common/src/lib/calculation-helper.ts
|
|
@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
|
- Upgraded `twitter-api-v2` from version `1.27.0` to `1.29.0` |
|
|
- Upgraded `twitter-api-v2` from version `1.27.0` to `1.29.0` |
|
|
|
|
|
|
|
|
|
|
|
### Fixed |
|
|
|
|
|
|
|
|
|
|
|
- Fixed an issue in the annualized performance calculation |
|
|
|
|
|
|
|
|
## 2.237.0 - 2026-02-08 |
|
|
## 2.237.0 - 2026-02-08 |
|
|
|
|
|
|
|
|
### Changed |
|
|
### Changed |
|
|
|
|
|
@ -9,7 +9,7 @@ import { |
|
|
subDays, |
|
|
subDays, |
|
|
subYears |
|
|
subYears |
|
|
} from 'date-fns'; |
|
|
} from 'date-fns'; |
|
|
import { isNumber } from 'lodash'; |
|
|
import { isFinite, isNumber } from 'lodash'; |
|
|
|
|
|
|
|
|
import { resetHours } from './helper'; |
|
|
import { resetHours } from './helper'; |
|
|
import { DateRange } from './types'; |
|
|
import { DateRange } from './types'; |
|
|
@ -28,7 +28,7 @@ export function getAnnualizedPerformancePercent({ |
|
|
exponent |
|
|
exponent |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
if (!isNaN(growthFactor)) { |
|
|
if (isFinite(growthFactor)) { |
|
|
return new Big(growthFactor).minus(1); |
|
|
return new Big(growthFactor).minus(1); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|