Skip to content

Commit

Permalink
fix pnl
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian0701 committed Aug 29, 2023
1 parent 0a6e297 commit fd8b971
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ const UserPersonalRanking = ({timeSpan, rankingData}: IUserPersonalRankingProps)
const gapPnl =
// Info: (20230809 - Julian) 如果前一名和我的 PNL 方向一樣,則相減後取絕對值
previousPnl.type === myPnl.type
? Math.abs(previousPnl.value - myPnl.value)
: // Info: (202300809 - Julian) 如果前一名和我的 PNL 方向相反,則相加後取絕對值
Math.abs(previousPnl.value + myPnl.value);
? Math.abs(+previousPnl.value - +myPnl.value)
: // Info: (20230809 - Julian) 如果前一名和我的 PNL 方向相反,則相加後取絕對值
Math.abs(+previousPnl.value + +myPnl.value);

const gapPnlFormatted = gapPnl.toLocaleString(UNIVERSAL_NUMBER_FORMAT_LOCALE, FRACTION_DIGITS);

Expand Down

0 comments on commit fd8b971

Please sign in to comment.