[GNC] Customizing invoices (Helmut Eller

John Ralls jralls at ceridwen.us
Tue Mar 29 18:14:28 EDT 2022



> On Mar 29, 2022, at 10:33 AM, Adrien Monteleone <adrien.monteleone at lusfiber.net> wrote:
> 
> The report should simply print the data from the invoice unchanged.

Be careful what you ask for. The data from the invoice is a rational number, meaning a numerator and a denominator. The print routine will print that as an integer plus a fraction. Remember all of the complaining a few years ago when the price editor showed numbers like 123 + 45/6789? Do you *really* want your invoices to look like that?

Or were you thinking "unchanged" means in decimal form but with no rounding? So if you have say 1/3 your printer keeps printing pages full of '3' until it runs out of paper? ;-)


There's a preference for force prices to decimal. If that's set then prices displayed in the Price Database window and the register are rounded to 1/100th of the smallest currency unit in which the price is denominated. For most currencies that's two decimal places so prices are displayed with four. The same could be applied to invoices and other reports.

I'd think amounts on invoices should be in some integer multiple of the commodity's smallest fraction traded--that's a property of the commodity that you set in the New/Edit Security dialog--and should display as a decimal with the appropriate number of places if the fraction's denominator is a power of 10 or a rational number if not. 

Does that seem reasonable?

Regards,
John Ralls



More information about the gnucash-user mailing list