Hi Alexis,
I'm impressed!
Also the example showed me the way.
Also got it working now, allthough not with "amount" as mentioned in the
example, but with "display_amount". I think that was where i got stuck last
time:
ledger -X € --format "%(account) \t %8(quantity(scrub(roundto(display_amount,
2)))) \t %(quantity(scrub(display_amount)))\n" reg ^exp ^bank
BR,
Hans Erik
** working out a working format string rouding of to 2 digits
#+name: transactions_multiple_commodities2
#+begin_src ledger :noweb yes
P 2013/12/02 17:00:00 GBP €1,2604
2013/12/02 ACME
Expenses:A € 0,01
Assets
2014/01/02 ACME
Expenses:A € 1,00
Assets
2014/01/02 ACME
Expenses:A 1,00 GBP
Assets
2014/02/02 ACME
Expenses:B € 0,01
Assets
2014/03/02 ACME
Expenses:B € 0,02
Assets
2014/03/02 ACME
Expenses:C € 1,00
BankAccount (-€1,00/3) ; [2014/03/02]
BankAccount (-€1,00/3) ; [2014/04/02]
BankAccount (-€1,00/3) ; [2014/05/02]
#+end_src
#+begin_src ledger :cmdline -X € --format "%(account) \t
%8(quantity(scrub(roundto(display_amount, 2)))) \t
%(quantity(scrub(display_amount)))\n" reg ^exp ^bank :noweb yes
<<transactions_multiple_commodities2>>
#+end_src
#+RESULTS:
#+begin_example
Expenses:A 0.01 0.01
<Adjustment> 0 0
Expenses:A 1 1
Expenses:A 1.26 1.2604
Expenses:B 0.01 0.01
Expenses:B 0.02 0.02
Expenses:C 1 1
BankAccount -0.33 -0.33
<Adjustment> -0.01 -0.01
BankAccount -0.33 -0.33
BankAccount -0.33 -0.33
#+end_example
Op maandag 19 januari 2015 17:33:29 UTC+1 schreef unices:
>
> Hi Erik,
> > list of formatting handlers:
> > - foo(x,y): <one line description> foo performs ... and takes an
> argument
> > x that controls ... and argument y that ...
> > <one line example of a typical use> foo(amount,2) results
> in
> > amount to be displayed fooed a level of 2 times
> > - bar(x): ...
>
> Thanks, that was quite helpful. Please have a look at the final HTML at
> http://jsfiddle.net/dd98hLx5/2/
> is something like that you had in mind?
>
> I've used texinfo's @defun, @defvar, et al to document the value
> expressions accordingly and with only minimal changes to
> test/DocTests.py I'm able to have the @smallexample's for each
> value expression run and tested, yay!
>
> Have a look at the changes proposed in
> https://github.com/ledger/ledger/pull/373
> and feel free to comment.
>
>
> Cheers,
> Alexis
>
--
---
You received this message because you are subscribed to the Google Groups
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.