FastGPT/src/utils/user.ts
2023-05-10 12:03:54 +08:00

18 lines
366 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { PRICE_SCALE } from '@/constants/common';
import { loginOut } from '@/api/user';
export const clearCookie = () => {
try {
loginOut();
} catch (error) {
error;
}
};
/**
* 把数据库读取到的price转化成元
*/
export const formatPrice = (val = 0, multiple = 1) => {
return Number(((val / PRICE_SCALE) * multiple).toFixed(10));
};