|
|
|
@ -110,3 +110,16 @@ export const paginationAction = (pageInfo = {}, i18n = {}, onChange, onShowSizeC
|
|
|
|
|
showSizeChanger: true
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* Description:
|
|
|
|
|
* Params: 格式化钱
|
|
|
|
|
* Date: 2023/12/6
|
|
|
|
|
*/
|
|
|
|
|
export const toDecimal_n = (num, decimalPlaces) => {
|
|
|
|
|
if (num === null || !isFinite(num)) return null
|
|
|
|
|
if (decimalPlaces < 0) return null;
|
|
|
|
|
const multiplier = Math.pow(10, decimalPlaces);
|
|
|
|
|
const roundedNum = Math.round(num * multiplier) / multiplier;
|
|
|
|
|
return roundedNum.toFixed(decimalPlaces);
|
|
|
|
|
};
|
|
|
|
|