Repository navigation
fix(xbrl): render stock par values at their filed precision - #1542
Merged
Merged
Conversation
The per-share formatter rounded values under 10 to three decimal places and then padded to two, so Apple's exact $0.00001 common par value (FY2023 10-K, 0000320193-23-000106) rendered as 0.00. It now keeps the precision the fact was filed with: every digit of an exact (INF) value, or the filed decimals when finer than three. Values filed at three decimals or fewer format as before. PreferredStockParOrStatedValuePerShare was missing from eps_concepts, so it was formatted as a monetary amount at the statement's scale and Tesla's $0.001 preferred par value (Q2 2024 10-Q, 0001628280-24-032662) rendered as 0. Fixes dgunning#1475
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Rendered statements no longer show a nonzero stock par value as zero. Apple's FY2023 parenthetical balance sheet showed its $0.00001 common par value as
0.00. Tesla's Q2 2024 one showed its $0.001 preferred par value as0, and JPMorgan's FY2023 one showed its $1 preferred par value as0. All three now display the filed value:0.00001,0.001and1.00.There were two separate causes, both in
edgar/xbrl/rendering.py:0.00001became0.00. It now keeps any finer precision the fact was filed with: every digit of an exact (decimals="INF") value, or the fileddecimalswhen that is above 3. Values filed at 3 decimals or fewer format exactly as before. Apple's EPS rows (6.16 / 6.13) are unchanged.us-gaap_PreferredStockParOrStatedValuePerSharewasn't ineps_concepts, so it went through the generic monetary formatter and picked up the statement's millions scale. It's now in the list next toCommonStockParOrStatedValuePerShare. Tesla's common par value, which was already in the list and already showed0.001, is the control.test_recognized_share_and_per_share_domains_remain_explicitin the #1470 test pins the per-share list, so I added the new concept to its expected tuple.Fixes #1475
Verification
0000320193-23-000106(tests/fixtures/xbrl/aapl/10k_2023). Facts f-196 and f-197 areCommonStockParOrStatedValuePerShare=0.00001,decimals="INF",usdPerShare, at 2023-09-30 and 2022-09-24.0001628280-24-032662(tests/fixtures/xbrl/tsla). Facts f-84 and f-85 arePreferredStockParOrStatedValuePerShare=0.001,decimals="INF", at 2024-06-30 and 2023-12-31.0000019617-24-000225(tests/fixtures/xbrl/jpm/10k_2024). Facts f-286 and f-287 arePreferredStockParOrStatedValuePerShare=1,decimals="INF". Before the fix it showed0, next to the common par value's1.00.tests/issues/regression/test_issue_1475_par_value_precision.py, and its docstring links the issue. It goes throughstatements.balance_sheet(parenthetical=True).render()withstandard=Falseandstandard=True, and it also checks the printed statement and Apple's EPS rows. Before the fix, 8 of its 12 cases fail (['0.00', '0.00'],['0', '0'], and'0.237'for a dividend filed with 4 decimals). After the fix, all 12 pass.changelog.d/1475.fixed.md.scripts/release/assemble_changelog.py --checkaccepts it.I also ran the whole
-m fastsuite on this branch and onmain(Windows, Python 3.12). Both runs fail the same set of tests, which is environment-specific (bs4 baselines, symlinks, console encoding). The only difference is the new test file.6.0
docs/upgrade/6.0.mdsays what users see now and what to do instead