Hyperlinkv0.8.0-beta.28

BigDecimal

BigDecimal.minconsteffect/BigDecimal.ts:957
(that: BigDecimal): (self: BigDecimal) => BigDecimal
(self: BigDecimal, that: BigDecimal): BigDecimal

Returns the minimum between two BigDecimals.

When to use

Use to select the smaller of two BigDecimal values.

Example (Selecting the smaller decimal)

import { BigDecimal } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(
  BigDecimal.min(BigDecimal.fromStringUnsafe("2"), BigDecimal.fromStringUnsafe("3")),
  BigDecimal.fromStringUnsafe("2")
)
mathmax
export const min: {
  (that: BigDecimal): (self: BigDecimal) => BigDecimal
  (self: BigDecimal, that: BigDecimal): BigDecimal
} = order.min(Order)