src/finanza@decimal@rounding.erl

-module(finanza@decimal@rounding).
-compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch, inline]).
-define(FILEPATH, "src/finanza/decimal/rounding.gleam").
-export_type([mode/0]).

-if(?OTP_RELEASE >= 27).
-define(MODULEDOC(Str), -moduledoc(Str)).
-define(DOC(Str), -doc(Str)).
-else.
-define(MODULEDOC(Str), -compile([])).
-define(DOC(Str), -compile([])).
-endif.

?MODULEDOC(
    " Rounding modes for decimal arithmetic.\n"
    "\n"
    " Every operation in [`finanza/decimal`](../decimal.html) that can\n"
    " reduce precision takes a `Mode` so the rounding behaviour is\n"
    " explicit. The seven modes match the IBM General Decimal Arithmetic\n"
    " specification (see `doc/reference/specs/ibm-decimal-arithmetic.md`).\n"
).

-type mode() :: half_even | half_up | half_down | up | down | ceiling | floor.