Skip to content

Directory: show the buy box for DEM amounts with trailing zeros past nine decimals - #271

Closed
randomblocker wants to merge 1 commit into
phase0-completionfrom
contrib/community-219-dem-trailing-zeros
Closed

randomblocker wants to merge 1 commit into
phase0-completionfrom
contrib/community-219-dem-trailing-zeros

Conversation

@randomblocker

@randomblocker randomblocker commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

The service page hid the buy box for a published DEM price such as 1.5000000000, because the check allowed at most nine decimal digits even though the
value is exactly representable in base units and the SDK accepts it. The check now accepts zeros after the ninth decimal. A price with a non-zero digit
past the ninth decimal, such as 1.0000000001, still hides the box, and so does a zero amount.

Tested by adding both amounts to test/service-page.test.ts: 1.5000000000 shows the box and 1.0000000001 does not. The first assertion failed before the
change. The service page test file passes (2 of 2), the whole directory suite passes (1696 pass, 0 fail, 1 skipped) and npm run typecheck is clean.

It does not change how other listing pages, the listing API or the SDK handle amounts; only this one display check.

Closes #219

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…nine decimals

A published price such as 1.5000000000 is exactly representable in base units, but the service page hid the buy box because it allowed at most nine decimal digits. Zeros after the ninth decimal are now accepted; a non-zero digit past the ninth decimal still hides the box.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@randomblocker

Copy link
Copy Markdown
Contributor Author

Closing without merging. Review found the case it handles cannot occur: a listing's fixed price must be in canonical form, so 1.5000000000 is rejected when the listing is published (the SDK's isPricingSpec returns false for it), and the Directory's verifyListingArtifact rejects non-canonical prices before indexing. The catalog never holds a price with trailing zeros, so the service page check never sees one. The test reached the new branch only by writing a catalog summary directly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant