Browse Source

Bugfix/fix algebraic sign in twitter bot service (#4158)

* Fix -0.0 to 0.0

* Update changelog
pull/4160/head
Thomas Kaul 3 weeks ago
committed by GitHub
parent
commit
167abe4107
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      CHANGELOG.md
  2. 10
      apps/api/src/services/twitter-bot/twitter-bot.service.ts

4
CHANGELOG.md

@ -28,6 +28,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `Nx` from version `20.1.2` to `20.3.0`
- Upgraded `zone.js` from version `0.14.10` to `0.15.0`
### Fixed
- Fixed an issue with the algebraic sign in the twitter bot service
## 2.131.0 - 2024-12-25
### Changed

10
apps/api/src/services/twitter-bot/twitter-bot.service.ts

@ -87,9 +87,15 @@ export class TwitterBotService {
return benchmarks
.map(({ marketCondition, name, performances }) => {
return `${name} ${(
let changeFormAllTimeHigh = (
performances.allTimeHigh.performancePercent * 100
).toFixed(1)}%${
).toFixed(1);
if (Math.abs(parseFloat(changeFormAllTimeHigh)) === 0) {
changeFormAllTimeHigh = '0.0';
}
return `${name} ${changeFormAllTimeHigh}%${
marketCondition !== 'NEUTRAL_MARKET'
? ' ' + resolveMarketCondition(marketCondition).emoji
: ''

Loading…
Cancel
Save