unyt-org/datex

Implement amount core value

Open

#564 opened on Dec 28, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Rust (2 forks)github user discovery
good first issue

Repository metrics

Stars
 (14 stars)
PR merge metrics
 (PR metrics pending)

Description

We have to implement Amount<T> as generic amount type.

  • durations
  • currencies
  • measurements (length, weight, volume, etc)
  • ... all other SI units
Amount<T> // generic amount type
Amount<meter> / Amount<kilometer>
Unit<kg> / Unit<g>

multiplication and division of units of different bases are allowed, other arithmetic operations only allowed on same base units. If same amount divided by same amount, result is decimal (unitless number)

Contributor guide