Files
FastGPT/packages/global/support/wallet/bill/tools.ts
2023-11-09 09:46:57 +08:00

11 lines
288 B
TypeScript

/* bill common */
import { PRICE_SCALE } from './constants';
import { BillItemType, BillSchema } from './type';
/**
* dataset price / PRICE_SCALE = real price
*/
export const formatPrice = (val = 0, multiple = 1) => {
return Number(((val / PRICE_SCALE) * multiple).toFixed(10));
};