diff --git a/src/charts/Customer_care_regular.jsx b/src/charts/Customer_care_regular.jsx
index 7ad9575..373d6d0 100644
--- a/src/charts/Customer_care_regular.jsx
+++ b/src/charts/Customer_care_regular.jsx
@@ -90,7 +90,7 @@ const Customer_care_regular = () => {
title: '订单数占比',
dataIndex: 'OrderRate',
key: 'OrderRate',
- render: (text) => typeof text === 'number'?{Math.round(text * 100)}%:text,
+ render: (text) => typeof text === 'number'?{parseFloat((text * 100).toFixed(2))}%:text,
},
{
title: '成行数',
@@ -112,7 +112,7 @@ const Customer_care_regular = () => {
title: '毛利占比',
dataIndex: 'OrderMLRate',
key: 'OrderMLRate',
- render: (text) => typeof text === 'number'?{Math.round(text * 100)}%:text,
+ render: (text) => typeof text === 'number'?{parseFloat((text * 100).toFixed(2))}%:text,
},
{
title: '人数(含成人+儿童)',
diff --git a/src/stores/CustomerStore.js b/src/stores/CustomerStore.js
index 0165b2a..10cf824 100644
--- a/src/stores/CustomerStore.js
+++ b/src/stores/CustomerStore.js
@@ -2,7 +2,7 @@ import {makeAutoObservable, runInAction} from "mobx";
import { fetchJSON } from '../utils/request';
import * as config from "../config";
import { groupsMappedByKey, sitesMappedByCode, pivotBy } from './../libs/ht';
-import { sortBy, show_vs_tag, formatPercent, groupBy, isEmpty, uniqWith } from "../utils/commons";
+import { sortBy, show_vs_tag, formatPercent, groupBy, isEmpty, uniqWith, formatPercentToFloat } from "../utils/commons";
import moment from 'moment';
/**
@@ -242,13 +242,13 @@ class CustomerStore {
SUCOrderNum: show_vs_tag(formatPercent((item1.SUCOrderNum-item2.SUCOrderNum)/(item2.SUCOrderNum===0?1:item2.SUCOrderNum)),
item1.SUCOrderNum-item2.SUCOrderNum,item1.SUCOrderNum,item2.SUCOrderNum),
OrderRate: show_vs_tag(formatPercent((item1.OrderRate-item2.OrderRate)/item2.OrderRate),
- formatPercent(item1.OrderRate-item2.OrderRate),formatPercent(item1.OrderRate),formatPercent(item2.OrderRate)),
+ formatPercentToFloat(item1.OrderRate-item2.OrderRate),formatPercentToFloat(item1.OrderRate),formatPercentToFloat(item2.OrderRate)),
SUCRate: show_vs_tag(formatPercent((item1.SUCRate-item2.SUCRate)/(item2.SUCRate===0?1:item2.SUCRate)),
formatPercent(item1.SUCRate-item2.SUCRate),formatPercent(item1.SUCRate),formatPercent(item2.SUCRate)),
ML: show_vs_tag(formatPercent((item1.ML-item2.ML)/(item2.ML===0?1:item2.ML)),
(item1.ML-item2.ML).toFixed(2),item1.ML,item2.ML),
OrderMLRate: show_vs_tag(formatPercent((item1.OrderMLRate-item2.OrderMLRate)/item2.OrderMLRate),
- formatPercent(item1.OrderMLRate-item2.OrderMLRate),formatPercent(item1.OrderMLRate),formatPercent(item2.OrderMLRate)),
+ formatPercentToFloat(item1.OrderMLRate-item2.OrderMLRate),formatPercentToFloat(item1.OrderMLRate),formatPercentToFloat(item2.OrderMLRate)),
PersonNum: show_vs_tag(formatPercent((item1.PersonNum-item2.PersonNum)/(item2.PersonNum===0?1:item2.PersonNum)),
item1.PersonNum-item2.PersonNum,item1.PersonNum,item2.PersonNum),
});
diff --git a/src/utils/commons.js b/src/utils/commons.js
index 86b4b7a..a66419b 100644
--- a/src/utils/commons.js
+++ b/src/utils/commons.js
@@ -72,6 +72,10 @@ export function formatPercent(number) {
return Math.round(number * 100) + "%";
}
+export function formatPercentToFloat(number) {
+ return parseFloat((number * 100).toFixed(2)) + "%";
+}
+
export function percentToDecimal(number) {
return parseFloat(number) / 100;
}