reproducible, & possibly configurable rounding

tripun goel tripun at gmail.com
Thu May 8 21:35:11 EDT 2014


Hi Martin,

On Fri, May 9, 2014 at 12:41 AM, Martin Michlmayr <tbm at cyrius.com> wrote:

> * tripun goel <tripun at gmail.com> [2014-05-09 00:12]:
> > The problem is that you cannot set this display precision before
> > hand. So if you have a transaction less precise than the actual
> > amount.
>
> You can set the precision with D
>
> D $1000.00000
>
> 2014-05-01 * Test
>     A     $0.01
>     B
>
> $ ledger -f c reg a
> 2014-05-01 Test                 A                          $0.01000
>  $0.01000
>
>
Thanks for explaining , I also tried it and found it working.

D AMOUNT Specifies the default commodity to use, by specifying an amount in
the expected format. The xact command will use this commodity as the
default when none other can be determined. This command may be used
multiple times, to set the default flags for different commodities;
whichever is seen last is used as the default commodity. For example, to
set US dollars as the default commodity, while also setting the thousands
flag and decimal flag for that commodity, use:

          D $1,000.00


I gave the following test

D $1000.00000
2014/03/21 * Test Round off
  Expenses          1 EUR @  $0.0086
  Expenses                 1 CAD @  $0.0083
  Income     -$0.0

2014/03/21 * Test Round off
  Expenses          1 EUR @  $0.0086
  Expenses                 1 CAD @  $0.0083
  Income     -$0.02

2014/03/21 * Test Round off
  Expenses          1 EUR @  $0.0086
  Expenses                 1 CAD @  $0.0083
  Income     -$0.0169


and found it working even without round option. I received the expected
error

edger -f legtest/round.txt --unround -V -E     balance
While parsing file "/home/test/legtest/round.txt", line 6:
While balancing transaction from "/home/test/legtest/round.txt", lines 2-6:
> 2014/03/21 * Test Round off
>   Expenses          1 EUR @  $0.0086
>   Expenses                 1 CAD @  $0.0083
>   Income      -$0.0
>
Unbalanced remainder is:
            $0.01690
Amount to balance against:
            $0.01690
Error: Transaction does not balance
While parsing file "/home/test/legtest/round.txt", line 11:
While balancing transaction from "/home/test/legtest/round.txt", lines 7-11:
> 2014/03/21 * Test Round off
>   Expenses          1 EUR @  $0.0086
>   Expenses                 1 CAD @  $0.0083
>   Income      -$0.02
>
Unbalanced remainder is:
           $-0.00310
Amount to balance against:
            $0.01690
Error: Transaction does not balance

What do you think , should it remain as an input format or it will do
better as an option to command line ? I mean you cannot expect people to
use it in input file if it is imported from other programs such as a csv or
gnucash file?

Regards
Tripun Goel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/npo-accounting/attachments/20140509/c168be40/attachment.html>


More information about the npo-accounting mailing list