feat(core): sums and totals over arrays of minor units

Open
#328 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
backend

Research direction

Start with docs/reference/limitations.md and the existing sum and fromMinor implementations to understand their precision and performance behavior. The issue leaves the API name and whether to add min, max, or average undecided, so those decisions need to be resolved before implementation. Done means an exact array summation API, validation for number inputs, benchmarks showing no regression to sum, and documentation of the min/max/average decision.

Written by the indexing model from the issue text.

Description

area: core

From docs/reference/limitations.md (Alex, 2026-11-13: worth doing soon).

There's no columnar API: summing a Float64Array, BigInt64Array or plain array of minor units means building a Money per element.

  • sumMinor(values, currency, { scale? }) (name to decide) taking number arrays, typed arrays and bigint arrays, exact, with the same number fast path plus bigint fallback as sum
  • refuses non-integers and unsafe numbers in number arrays, like fromMinor
  • a benchmark against summing Money values, with no regression to sum
  • decide whether min/max/average belong here too; document the decision
Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
35m
Merged PRs (30d)
242

Getting set up

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.

More from public/ducat

All issues in public/ducat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.