mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 03:09:19 +08:00
fix: 统一盈亏字段精度为 2 位小数;修复 sub_plan_pricing.status 拼写错误
- CompanyOverviewServiceImpl / CategoryExportExcelServiceImpl / ExportServiceImpl / ShopOverviewStatisticsServiceImpl / ProductOverviewServiceImpl:所有 profitAfterTax / netProfit 等盈亏字段统一 setScale(2, RoundingMode.HALF_UP),避免 JSON 序列化时出现过多小数位 - sub_design.sql:stauts → status 拼写修正 - 前端:品类/商品排行榜/概览卡片等表格 feeRatio / roi 等数值精度统一展示处理
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* 店铺/全店概览接口:费比 feeRatio / averageFeeRatio 为小数(推广费÷销售额,如 0.05 = 5%)。
|
||||
* 达成率等字段后端已为 0–100 的数值,勿用本函数。
|
||||
*/
|
||||
export function formatFeeRatioPercent(value: number | undefined | null): string {
|
||||
if (value === undefined || value === null) return '-';
|
||||
const n = Number(value);
|
||||
if (!Number.isFinite(n)) return '-';
|
||||
return `${(n * 100).toFixed(1)}%`;
|
||||
}
|
||||
Reference in New Issue
Block a user