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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
12 additions and
2 deletions
-
CHANGELOG.md
-
apps/api/src/services/twitter-bot/twitter-bot.service.ts
|
@ -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 `Nx` from version `20.1.2` to `20.3.0` |
|
|
- Upgraded `zone.js` from version `0.14.10` to `0.15.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 |
|
|
## 2.131.0 - 2024-12-25 |
|
|
|
|
|
|
|
|
### Changed |
|
|
### Changed |
|
|
|
@ -87,9 +87,15 @@ export class TwitterBotService { |
|
|
|
|
|
|
|
|
return benchmarks |
|
|
return benchmarks |
|
|
.map(({ marketCondition, name, performances }) => { |
|
|
.map(({ marketCondition, name, performances }) => { |
|
|
return `${name} ${( |
|
|
let changeFormAllTimeHigh = ( |
|
|
performances.allTimeHigh.performancePercent * 100 |
|
|
performances.allTimeHigh.performancePercent * 100 |
|
|
).toFixed(1)}%${ |
|
|
).toFixed(1); |
|
|
|
|
|
|
|
|
|
|
|
if (Math.abs(parseFloat(changeFormAllTimeHigh)) === 0) { |
|
|
|
|
|
changeFormAllTimeHigh = '0.0'; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return `${name} ${changeFormAllTimeHigh}%${ |
|
|
marketCondition !== 'NEUTRAL_MARKET' |
|
|
marketCondition !== 'NEUTRAL_MARKET' |
|
|
? ' ' + resolveMarketCondition(marketCondition).emoji |
|
|
? ' ' + resolveMarketCondition(marketCondition).emoji |
|
|
: '' |
|
|
: '' |
|
|