Skip to content

@xtandard/lib/dinero

Money intervals: the generic Interval engine bound to dinero.js v2 values (peer dependency dinero.js, which also re-exports the currency definitions). See docs/INTERVAL.md#money-intervals.

import { … } from "@xtandard/lib/dinero";
Name Summary
createDineroInterval Bind a dinero.js currency to a new-able interval CLASS (see defineIntervalType). The string form is the currency’s minor units.
dineroDomain Build an IntervalDomain for one dinero.js currency. DISCRETE — the epsilon is one minor unit at the currency’s standard exponent. All stepping/measuring/serialization happens in those minor units; compare defers to dinero’s own (scale-aware) comparison. createDineroInterval wraps this in a class; use the domain directly with parseInterval/mergeIntervals.
Name Summary
DineroInterval A money interval over one currency — an Interval of dinero.js values.