Skip to main content

Function: Decimal()

Decimal(options?): PropertyDecorator

Defined in: src/decorators/DecimalDecorator.ts:24

Property decorator defining a high-precision decimal database column. Typically maps to SQL DECIMAL(precision, scale) or NUMERIC(precision, scale). Default precision is 18 and scale is 4.

Parameters​

ParameterTypeDescription
options?DecimalOptionsDecimal precision and scale options.

Returns​

PropertyDecorator

Example​

@Decimal({ precision: 18, scale: 4 })
balance!: string;