Package: effect
Module: BigDecimal
Provides a negate operation on BigDecimals.
When to use
Use to flip the sign of a BigDecimal.
Example (Negating decimals)
import { BigDecimal } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigDecimal.negate(BigDecimal.fromStringUnsafe("3")), BigDecimal.fromStringUnsafe("-3"))
assert.deepStrictEqual(BigDecimal.negate(BigDecimal.fromStringUnsafe("-6")), BigDecimal.fromStringUnsafe("6"))
Signature
declare const negate: (n: BigDecimal) => BigDecimal
Since v2.0.0