:decimal_mode_swap — swaps Decimal rounding and string-format mode atoms.
The family targets mode arguments whose legal value set is Decimal-specific:
Decimal.round(num, places, :half_up) # -> :half_down / :half_even
Decimal.round(num, places, :ceiling) # -> :floor
Decimal.round(num, places, :up) # -> :down
Decimal.to_string(num, :normal) # -> :xsd / :raw
Decimal.to_string(num, :scientific, opts) # -> :normal / :xsd / :rawA pipe stage is mutated as the call it stands for: num |> Decimal.to_string(:normal) gets
the to_string/2 swaps.
To avoid duplicates with the drop families, swaps to a default mode are excluded where dropping the argument produces an equivalent mutation. Mutare.Decimal.DefaultDrop drops round/3's mode (equivalent to :half_up), and Mutare.Decimal.LimitsDrop drops to_string/2's format (equivalent to :scientific). For to_string/3, LimitsDrop removes the trailing options, not the format, so :scientific remains a swap target. Because :half_up is never a swap target, it is not included in this family's variant labels.
Summary
Functions
The target-mode labels accepted by qualified mutare ignore directives.
Functions
@spec variants() :: [atom()]
The target-mode labels accepted by qualified mutare ignore directives.