Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Feature/remove dependency round to (#972)

Thomas Kaulbbe30218bd7a
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ddffe90a2a..40ddf370e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improved the tooltips of the chart components (content and style)
- Simplified the pricing page
+- Improved the rounding numbers in the twitter bot service
+- Removed the dependency `round-to`
## 1.153.0 - 27.05.2022
diff --git a/apps/api/src/services/twitter-bot/twitter-bot.service.ts b/apps/api/src/services/twitter-bot/twitter-bot.service.ts
index d820d6c11b..402159add4 100644
--- a/apps/api/src/services/twitter-bot/twitter-bot.service.ts
+++ b/apps/api/src/services/twitter-bot/twitter-bot.service.ts
@@ -14,7 +14,6 @@ import {
import { UniqueAsset } from '@ghostfolio/common/interfaces';
import { Injectable, Logger } from '@nestjs/common';
import { isWeekend } from 'date-fns';
-import * as roundTo from 'round-to';
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2';
@Injectable()
@@ -100,10 +99,9 @@ export class TwitterBotService {
}
benchmarkListing.push(
- `${benchmark.name} ${roundTo(
- benchmark.performances.allTimeHigh.performancePercent * 100,
- 1
- )}%${
+ `${benchmark.name} ${(
+ benchmark.performances.allTimeHigh.performancePercent * 100
+ ).toFixed(1)}%${
benchmark.marketCondition !== 'NEUTRAL_MARKET'
? ' ' + resolveMarketCondition(benchmark.marketCondition).emoji
: ''
diff --git a/package.json b/package.json
index cd05f856dc..46d86ef40a 100644
--- a/package.json
+++ b/package.json
@@ -111,7 +111,6 @@
"passport-jwt": "4.0.0",
"prisma": "3.14.0",
"reflect-metadata": "0.1.13",
- "round-to": "5.0.0",
"rxjs": "7.4.0",
"stripe": "8.199.0",
"svgmap": "2.6.0",
diff --git a/yarn.lock b/yarn.lock
index e4cf8ed396..5beca0f91b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -16563,11 +16563,6 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^3.0.0"
inherits "^2.0.1"
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/round-to/-/round-to-5.0.0.tgz#a66292701a93b194f630a0d57f04c08821b6eeed"
- integrity sha512-i4+Ntwmo5kY7UWWFSDEVN3RjT2PX1FqkZ9iCcAO3sKML3Ady9NgsjM/HLdYKUAnrxK4IlSvXzpBMDvMHZQALRQ==
-
rsvp@^4.8.4:
version "4.8.5"
resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734"