diff --git a/common/util/format.ts b/common/util/format.ts index 5a8ad41e..2d8e5d00 100644 --- a/common/util/format.ts +++ b/common/util/format.ts @@ -10,8 +10,8 @@ const formatter = new Intl.NumberFormat('en-US', { export function formatMoney(amount: number, explicitPositiveSign?: boolean) { const newAmount = Math.round(amount) === 0 ? 0 : Math.floor(amount) // handle -0 case return ( - (explicitPositiveSign && newAmount > 0 ? '+' : '') + ENV_CONFIG.moneyMoniker + + (explicitPositiveSign && newAmount > 0 ? '+' : '') + formatter.format(newAmount).replace('$', '') ) } diff --git a/functions/src/email-templates/weekly-portfolio-update.html b/functions/src/email-templates/weekly-portfolio-update.html index 53474677..547a6b3b 100644 --- a/functions/src/email-templates/weekly-portfolio-update.html +++ b/functions/src/email-templates/weekly-portfolio-update.html @@ -51,7 +51,7 @@ margin: 0; vertical-align: middle;font-size:16px;display: inline; padding: 2px; border-radius: 5px; } p.prob{ - font-size: 20px;display: inline; vertical-align: middle; + font-size: 20px;display: inline; vertical-align: middle; font-weight: bold; } a.question{ font-size: 18px;display: inline; vertical-align: middle; padding-bottom: 25px; @@ -229,7 +229,7 @@

We ran the numbers and here's how you did this past week! @@ -240,8 +240,18 @@ + + + Profit + + + + + {{profit}} + + + style="font-size:0px;padding:10px 20px;padding-top:0px;padding-bottom:0px;word-break:break-word;"> diff --git a/functions/src/weekly-portfolio-emails.ts b/functions/src/weekly-portfolio-emails.ts index 58aa2d99..51a85c9c 100644 --- a/functions/src/weekly-portfolio-emails.ts +++ b/functions/src/weekly-portfolio-emails.ts @@ -165,6 +165,7 @@ export async function sendPortfolioUpdateEmailsToAllUsers() { ) // get the difference const performanceData = { + profit: formatMoney(user.profitCached.weekly, true), investment_value: formatMoney( mostRecentPortfolioMetrics.investmentValue ), @@ -283,6 +284,7 @@ export type PerContractInvestmentsData = { questionChangeStyle: string } export type OverallPerformanceData = { + profit: string tips_received_style: string investment_change_style: string investment_value: string