force new bill to restrict the amount to $/c (2 decimal points)

This commit is contained in:
2025-08-21 16:51:57 +10:00
parent 3d95cd1d2e
commit c469f6d281

2
db.py
View File

@@ -290,7 +290,7 @@ def get_bill_freqs():
def new_bill( bill_type, amount, bill_date, estimated ): def new_bill( bill_type, amount, bill_date, estimated ):
conn = connect_db(False) conn = connect_db(False)
cur = conn.cursor() cur = conn.cursor()
cur.execute( f"insert into bill_data ( 'bill_type', 'amount', 'bill_date', 'estimated' ) values ( '{bill_type}', '{amount}', '{bill_date}', {estimated} )" ) cur.execute( f"insert into bill_data ( 'bill_type', 'amount', 'bill_date', 'estimated' ) values ( '{bill_type}', '{amount:.2f}', '{bill_date}', {estimated} )" )
conn.commit() conn.commit()
conn.close() conn.close()
return return