chore: complete the payment service
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// eslint-disable-next-line import/no-named-as-default
|
||||
import Decimal from "decimal.js";
|
||||
|
||||
export class DecimalTransformer {
|
||||
to(value: Decimal | string | number): string {
|
||||
return new Decimal(value).toString();
|
||||
}
|
||||
|
||||
from(value: string): number {
|
||||
return new Decimal(value).toNumber();
|
||||
}
|
||||
}
|
||||
|
||||
export function decimal(value: Decimal | number | string): number {
|
||||
return new Decimal(value).toNumber();
|
||||
}
|
||||
Reference in New Issue
Block a user