Setting precision for $

5 views
Skip to first unread message

David Glasser

unread,
May 22, 2022, 9:41:16 PMMay 22
to ledge...@googlegroups.com
I sold some stock at a price valued in half-cents. I modeled this in ledger like

2022-05-13 Buyer
  Bank  $100.50
  Shares  -100 STOCK @ $1.005

This means that Ledger now thinks that it should display every $ value with three digits of precision, which I don't like. How can I get $ back to just two digits?  I see you can specify precision with C when you define a commodity in terms of another one but I haven't done that for $...

Martin Michlmayr

unread,
May 22, 2022, 10:57:06 PMMay 22
to ledge...@googlegroups.com
* David Glasser <gla...@davidglasser.net> [2022-05-22 18:41]:
> I sold some stock at a price valued in half-cents. I modeled this in ledger
> like
>
> 2022-05-13 Buyer
> Bank $100.50
> Shares -100 STOCK @ $1.005
>
> This means that Ledger now thinks that it should display every $ value with
> three digits of precision

No, it doesn't. Price info (@ $...) is not used for precision.

I don't get 3 digits with your example. If you really get 3 digits,
it's because of another reason. Maybe you specified 3 digits in
another transaction.

--
Martin Michlmayr
https://www.cyrius.com/

David Glasser

unread,
May 22, 2022, 11:37:08 PMMay 22
to ledge...@googlegroups.com
You're right. By a strange coincidence I had a typo in another entry
on the same day.


--
gla...@davidglasser.net | flickr.com/photos/glasser/
Reply all
Reply to author
Forward
0 new messages