소스 검색

Fix EUR formatting

master
Peter Hatina 2 년 전
부모
커밋
f3e805f7ad
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      lib/invoice/cli.py

+ 6
- 1
lib/invoice/cli.py 파일 보기

@@ -179,11 +179,16 @@ class Application:

log.debug("Creating TeX invoice...")
self._check_path(self.tmp_path)

format_decimal=lambda x: '{:20,.2f}'.format(x).replace(',', '\\,').replace('.', ',')
format_eur=lambda x: format_decimal(x) + ' EUR'

result = tempita.Template(open(tex_template).read()).substitute(
invoice=invoice_data,
issuer=issuer_data,
customer=customer_data,
eur=lambda x: '{:20,.2f} EUR'.format(x).replace(',', '\\,').replace('.', ','))
decimal=format_decimal,
eur=format_eur)
open(tex_file, "w").write(str(result))
assert(os.path.exists(tex_file))



불러오는 중...
취소
저장