Closed tbm closed 8 years ago
Original comment by Zhuoyun Wei (Bitbucket: wzyboy, GitHub: wzyboy).
Hmm... I applied the changeset and tried again. The regex now replaces all numbers with a unit following it, i.e. "100.00 USD", but numbers without a unit are not processed, i.e. "100.00".
Thus, all "operating_currency"s are not getting replaced...
Original comment by Martin Blais (Bitbucket: blais, GitHub: blais).
I'm using a weak heuristic, only replacing numbers followed by some whitespace. Because the replacement is carried out on the entire text, I have to be careful to avoid messing up URLs, this is why I do this (yes, it's a bit of a kludge).
I think I see where the problem is: in the tree renderings. Let me see what I can do, I should probably have an automated test to verify this.
Original comment by Martin Blais (Bitbucket: blais, GitHub: blais).
Pull and try again, I improved the heuristic a bit: https://bitbucket.org/blais/beancount/commits/22d5b39c4bc0a9d0940e7c97f5245c062bb43170
It's still not great, I will add a unit test to ensure there are no numbers anywhere.
Original report by Zhuoyun Wei (Bitbucket: wzyboy, GitHub: wzyboy).
I use
bean-web foo.beancount --incognito
to do some public demo. However, some of the numbers in my stock shares are not hidden. It turns out that--incognito
callstextutils.replace_numbers()
to replace numbers withX
s, while the regular expression used in this function (\b([0-9,]+\.[0-9]*)\b([^0-9,.]|$)
) does not substitute numbers that without decimal dots.