Made xp weekly change more readable (#569)

This commit is contained in:
Alec LaLonde
2021-05-19 03:49:51 -06:00
committed by GitHub
parent 51f82e6e2c
commit cc8326361e

View File

@@ -49,6 +49,7 @@ export class GetXpCommand {
const userTotalCred = scAccount.totalCred;
const numWeeks = scAccount.cred.length;
const userWeeklyCred = scAccount.cred;
const variation =
(100 *
(userWeeklyCred[numWeeks - 1] - userWeeklyCred[numWeeks - 2])) /
@@ -87,7 +88,7 @@ export class GetXpCommand {
},
{
name: 'Weekly Change',
value: `${variation.toPrecision(2)}%`,
value: `${Math.round(variation)}%`,
inline: true,
},
)