reproducible, & possibly configurable rounding

Josh Berkus josh at agliodbs.com
Thu May 8 14:46:30 EDT 2014


On 05/08/2014 11:42 AM, tripun goel wrote:
>> I am aware of packages available for decimal representation in Python.
> Ledger-cli uses integer rationals for internal representations and
> calculations. This provide more accuracy than fixed point in long term. It
> also uses correct rounding before displaying the floating string. The
> problem is that you cannot set this display precision before hand. So if
> you have a transaction less precise than the actual amount. For example, if
> you have all the entries of the format $0.0 but the balance amount after
> calculations amounts to $0.0169, it will be rounded to $0.0. This error is
> carried further in register. Also you cannot set this precision by an
> option as of now(I didn't find and I am waiting for an answer)  and I hope
> to code that. It takes its cue from the entries parsed and the precision of
> displayed amounts in the input file.

Yeah, in pretty much all cases you want rounding to the precision of
currency to be the *last* step before storage.  If Ledger-CLI is
rounding at every stage of the transaction, that's a rather major bug.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


More information about the npo-accounting mailing list