[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Number registers and prices: digits after decimal point
From: |
Ralph Corderoy |
Subject: |
Re: Number registers and prices: digits after decimal point |
Date: |
Sat, 28 May 2022 11:13:23 +0100 |
Hi Karchnu,
A little bit more detail may help the list answer.
> I want to use groff for invoices. To that end, I need to format
> numbers with two digits after the decimal point. For example, from
> "100" to "100.00".
Are you aware that number registers are integers and you wish to always
append ‘.00’ because you only invoice whole Euros?
Are you doing arithmetic on the number registers? Or could the amounts
be stored in string registers instead.
Do you want these number register values to be interpolated in content
which is to be preprocessed by something like tbl(1) or pic(1)? If so,
which preprocessors.
> Also, I would like to create invoices in French, where the dot (".")
> actually is a comma (","), but I may be able to hack this, probably.
> And for "big" numbers, it should be written this way:
> From "1,000.00" to "1 000,00" (French style, with a space)
It's looking like a macro which produces the string you require may be
useful so something like
.ds t 3141592.65
Total \*[money \*t]
uses the macro ‘money’ to produce output as if
Total 3 141 592,65
was entered.
--
Cheers, Ralph.