Browse Source

format float to string

master
Alexandros Theodotou 6 months ago
parent
commit
5d26d1307a
Signed by: alex GPG Key ID: 022EAE42313D70F3
  1. 1
      .gitignore
  2. 2
      gen-invoice.py

1
.gitignore

@ -1,4 +1,5 @@
MY_PAYMENT_INFO.html
MY_PAYMENT_INFO_BANK_ONLY.html
MY_ADDRESS.html
companies.yaml
*_*.pdf

2
gen-invoice.py

@ -45,7 +45,7 @@ def find_company(name):
# returns a string with 2 decimal points from
# the given float
def float_to_string(num,n_decimals):
fmt = '{:.' + str(n_decimals) + 'f}'
fmt = '{:,.' + str(n_decimals) + 'f}'
return fmt.format(num)
# inserts the given text at the given line number

Loading…
Cancel
Save