New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Use Thousand Separators Without Using A Decimal Separator #399

Closed
ORYLY opened this Issue Sep 12, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@ORYLY

ORYLY commented Sep 12, 2016

Thousand separators in an amount number can't be used unless the number also has a decimal separator. If there is only one punctuation mark, it's always considered to be a decimal separator even if one or more of the following are present:

  • A "D directive" with:
    • A sample amount using only a thousand separator.
    • A sample amount using both thousand and decimal separators.
  • A commodity directive that defines a format similar to the sample amounts listed above.
  • A preceding transaction with an amount that uses a format similar to the sample amounts listed above.

For example:

D JPY 111,111,111
# also doesn't work:
# D JPY 111,111,111.0
# D JPY 1,111
# D JPY 1,111.0

2016/01/01 default_commodity
  (asset:no_comma)  100
  (asset:comma)  100,500

The balance sheet for this journal adds up to ""200,500" or "200.500" for either commodity, rather than "100,600".

Using a commodity directive also has incorrect totals. An unexpected value rounding also occurs with the format "JPY 111,111,111".

commodity JPY
  format JPY 111,111,111 # also causes unexpected rounding

#  format JPY 111,111,111.0
#  format JPY 1,111
#  format JPY 1,111.0

2016/01/01 yen
  (asset:commodity:no_comma)  JPY 100
  (asset:commodity:comma)  JPY 100,500

Using a preceding dummy transaction with a sample amount has the same output as the cases above:

2016/01/01 init
  (asset:commodity:init)  JPY 111,111,111
  (asset:commodity:init)  JPY -111,111,111
  # same output with the formats tried in other examples

2016/01/01 yen
  (asset:commodity:no_comma)  JPY 100
  (asset:commodity:comma)  JPY 100,500


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

simonmichael added a commit that referenced this issue Sep 13, 2016

doc: journal: clarify D directive
Example added, per #399 discussion.

@simonmichael simonmichael modified the milestone: 1.1 Dec 29, 2016

mstksg added a commit to mstksg/hledger that referenced this issue Feb 3, 2017

@ony

This comment has been minimized.

Show comment
Hide comment
@ony

ony Nov 3, 2017

Collaborator

Oh. How did I missed this. I've created a duplicate #487 and even pull request #635 to fix this slightly.

Collaborator

ony commented Nov 3, 2017

Oh. How did I missed this. I've created a duplicate #487 and even pull request #635 to fix this slightly.

@simonmichael

This comment has been minimized.

Show comment
Hide comment
@simonmichael

simonmichael Nov 3, 2017

Owner

Heh heh the hledger issue tracker is getting a bit... mazelike.

Owner

simonmichael commented Nov 3, 2017

Heh heh the hledger issue tracker is getting a bit... mazelike.

ony added a commit to ony/hledger that referenced this issue Nov 5, 2017

journal: use groups sep and prec for decimal hint
Use whole AmountStyle in process of resolving decimal/groups separator
ambiguity.

Resolve simonmichael#399

ony added a commit to ony/hledger that referenced this issue Nov 27, 2017

journal: use groups sep and prec for decimal hint
Use whole AmountStyle in process of resolving decimal/groups separator
ambiguity.

Resolve simonmichael#399

ony added a commit to ony/hledger that referenced this issue Nov 27, 2017

journal: use groups sep and prec for decimal hint
Use whole AmountStyle in process of resolving decimal/groups separator
ambiguity.

Resolve simonmichael#399

simonmichael added a commit that referenced this issue Nov 27, 2017

journal: use groups sep and prec for decimal hint
Use whole AmountStyle in process of resolving decimal/groups separator
ambiguity.

Resolve #399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment