Hyperlinkv0.8.0-beta.28

BigDecimal

BigDecimal.equalsconsteffect/BigDecimal.ts:1230
(that: BigDecimal): (self: BigDecimal) => boolean
(self: BigDecimal, that: BigDecimal): boolean

Checks whether two BigDecimals are equal.

When to use

Use to compare two BigDecimal values for numeric equality.

Example (Checking decimal equality)

import { BigDecimal } from "effect"

const a = BigDecimal.fromStringUnsafe("1.5")
const b = BigDecimal.fromStringUnsafe("1.50")
const c = BigDecimal.fromStringUnsafe("2.0")

console.log(BigDecimal.equals(a, b)) // true
console.log(BigDecimal.equals(a, c)) // false
predicatesEquivalence
export const equals: {
  (that: BigDecimal): (self: BigDecimal) => boolean
  (self: BigDecimal, that: BigDecimal): boolean
} = dual(2, (self: BigDecimal, that: BigDecimal): boolean => Equivalence(self, that))
Referenced by 1 symbols