chore: fix bug

This commit is contained in:
mahyargdz
2025-03-12 15:05:56 +03:30
parent 787f3d0426
commit 146c38025a
4 changed files with 12 additions and 121 deletions
@@ -11,8 +11,10 @@ export class DecimalTransformer implements ValueTransformer {
// return new Decimal(value).toNumber();
// }
to(value: Decimal | null): string | null {
return value ? value.toString() : "0";
to(value: Decimal | number | null): string | null {
if (value === null) return "0";
return value instanceof Decimal ? value.toString() : new Decimal(value).toString();
}
from(value: string | null): number {