(n: BigDecimal): booleanChecks whether a given BigDecimal is positive.
When to use
Use to test whether a BigDecimal is greater than zero.
Example (Checking positive decimals)
import { BigDecimal } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("-1")), false)
assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("0")), false)
assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("1")), true)predicates
Source effect/BigDecimal.ts:16751 lines
export const const isPositive: (
n: BigDecimal
) => boolean
Checks whether a given BigDecimal is positive.
When to use
Use to test whether a BigDecimal is greater than zero.
Example (Checking positive decimals)
import { BigDecimal } from "effect"
import * as assert from "node:assert"
assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("-1")), false)
assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("0")), false)
assert.deepStrictEqual(BigDecimal.isPositive(BigDecimal.fromStringUnsafe("1")), true)
isPositive = (n: BigDecimal(parameter) n: {
value: bigint;
scale: number;
normalized: BigDecimal;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
n: BigDecimal): boolean => n: BigDecimal(parameter) n: {
value: bigint;
scale: number;
normalized: BigDecimal;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
toString: () => string;
toJSON: () => unknown;
}
n.BigDecimal.value: bigintvalue > const bigint0: bigintbigint0Referenced by 2 symbols