TheVicky1 / TheVicky1/Pact_OS

docs: add code examples for lib/money.ts integer-cents calculations

Open Beginner friendly
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accessibility area:documentation beginner friendly community contributions-welcome difficulty:beginner enhancement good first issue help wanted time:<15m type:docs up-for-grabs
Dominant language
TypeScript
Stars
5
Forks
7
Avg merge
39m
Merged PRs (30d)
39

Description

🎯 What needs to be done

Add clear, copy-pasteable TypeScript code examples in docs/DEVELOPMENT.md showing how to use PACT's integer-cents financial arithmetic utilities from src/lib/money.ts.

Why this matters

PACT strictly forbids floating-point numbers for financial amounts (all currency is calculated in integer cents). New contributors need explicit examples in the developer guide to avoid common floating-point mistakes.

📍 Where to work

  • docs/DEVELOPMENT.md (Section 7: Development Best Practices)
  • src/lib/money.ts (Reference existing exported functions: formatCentsToDollars, dollarsToCents, sumCents)

🧭 Implementation guidance

  1. Open docs/DEVELOPMENT.md and navigate to Section 7 ("Development Best Practices").
  2. Under item 1 ("Integer-Cents for Currency"), add a fenced TypeScript code block showing:
    • Converting dollars string/number to cents using dollarsToCents
    • Formatting integer cents for UI display with formatCentsToDollars
    • Summing multiple transactions safely
  3. Ensure the markdown renders cleanly without formatting issues.

✅ Acceptance criteria

  • docs/DEVELOPMENT.md contains accurate TypeScript code examples for src/lib/money.ts.
  • Code examples use modern TypeScript syntax and import paths.
  • Markdown link validation passes with 0 broken links.

🧪 Verification

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Section 7 of docs/DEVELOPMENT.md and inspect the exported functions and signatures in src/lib/money.ts: formatCentsToDollars, dollarsToCents, and sumCents. Add copy-pasteable TypeScript examples using the repository’s import conventions, then verify that the Markdown renders cleanly and link validation passes with no broken links.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.