diff options
Diffstat (limited to 'python/bondallocation_email.py')
| -rw-r--r-- | python/bondallocation_email.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/python/bondallocation_email.py b/python/bondallocation_email.py index 1e8bef32..fa06960d 100644 --- a/python/bondallocation_email.py +++ b/python/bondallocation_email.py @@ -30,6 +30,13 @@ if __name__ == "__main__": params=(args.trade_date,), ) with dawndb.cursor() as d: + formatters = { + "net_amount": "{:.2f}".format, + "price": "{:.4f}".format, + "accrued": "{:.8f}".format, + "notional": "{:.0f}".format, + } + for row in df.itertuples(): d.execute( "SELECT tradeid, notional, fund FROM bond_allocation " @@ -56,7 +63,7 @@ if __name__ == "__main__": + "".join(allocations) + "</ul><br><br>Trade Details are attached in csv." + "<br><br><br>Thanks,<br>Flint<br></p><br>" - + bondtrade.to_html(index=False) + + bondtrade.to_html(index=False, formatters=formatters) ) em.send_email( subject=subject, |
