Browse Source

Fix -0.0 to 0.0

pull/4158/head
Thomas Kaul 8 months ago
parent
commit
83db7f7448
  1. 10
      apps/api/src/services/twitter-bot/twitter-bot.service.ts

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

@ -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
: '' : ''

Loading…
Cancel
Save