24 Apr 2024 |
sm | I see. Explanation:
- while importing test-1.csv the only AAPL amount it can see is the one in the csv. It has precision 0 (no decimal places), so it infers that as AAPL's style when generating the entry.
- while importing test-2.csv, it takes the style from the AAPL amount in the journal (from step 1), which has precision 0.
| 22:29:27 |
daveakre | Ah I see | 22:29:48 |
sm | to force it to work even when there is no real data in the journal, add a commodity declaration for AAPL | 22:30:15 |
daveakre | Is the best solution to pre-process the original CSV file to add decimal places? | 22:30:16 |
daveakre | Ah okay | 22:30:26 |
daveakre | That works for me | 22:30:37 |
daveakre | Thanks very much for taking a look | 22:30:49 |
sm | no problem daveakre | 22:30:59 |
daveakre | (It may be worth adding a small note about this on the import guide, or maybe in the "how to specify amounts" section, which is where I found myself trying to debug.) | 22:32:00 |
sm | * to force your preferred precision even when there is no real data in the journal, add a commodity declaration for AAPL | 22:32:13 |
sm | I added the https://hledger.org/dev/hledger.html#commodity-display-styles section for that fairly recently. If you have links to those places that's helpful | 22:33:32 |
daveakre | Ah I must have missed this before. I was thinking of https://hledger.org/1.33/hledger.html#setting-amounts, but I see there's already a note there in the latest documentation. | 22:39:51 |
sm | ok, I'll add a mention there | 22:40:44 |
sm | or at https://hledger.org/1.33/hledger.html#amount-decimal-places perhaps | 22:41:22 |
sm | or the latest dev version, rather | 22:41:35 |
daveakre | That's a great idea. I think it's alluded to there, but you have to think carefully about it. | 22:43:42 |
daveakre | * That's a great idea. I think it's alluded to there, but you have to think carefully about it if you don't know exactly what you're looking for. | 22:43:54 |
sm | indeed, I appreciate the report | 22:49:24 |
daveakre | * Ah interesting, I hadn't used debugging for importing | 22:52:33 |
sm | https://hledger.org/dev/hledger.html#amount-decimal-places expanded. That was a bit hard to describe | 23:42:53 |
sm | daveakre ^ | 23:42:56 |
daveakre | It's definitely difficult to describe | 23:44:30 |
daveakre | But despite that difficulty, that description is excellent | 23:44:56 |
daveakre | Thanks very much for adding it | 23:45:29 |
25 Apr 2024 |
| Man of Letters removed their profile picture. | 13:43:15 |
| Man of Letters set a profile picture. | 13:43:26 |
sol | Hello. I'm not sure if it's a bug or a feature, but the commodity style directive is not being obeyed in the HTML output. | 14:09:04 |
sol | I tried both commodity INR 1,00,00,000.00 in the journal as well as --commodity-style 'INR 1,00,00,000.00' on the command-line. | 14:10:14 |
sol | The commas show up fine in the text output, but not if I pass -O html . | 14:10:42 |
| Nguyễn Trọng Cường joined the room. | 14:28:49 |