From 963a9821ae6a97b4d51ff4da8f65dd547e9ce7c2 Mon Sep 17 00:00:00 2001 From: huayj Date: Mon, 26 Aug 2019 21:12:36 +0800 Subject: [PATCH] =?UTF-8?q?number=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TableCell.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TableCell.js b/src/TableCell.js index 661e850..ece74ba 100644 --- a/src/TableCell.js +++ b/src/TableCell.js @@ -90,7 +90,7 @@ class TableCell extends Component{ renderNumber = (data, config={}, width=200) => { const { precision, thousand, makeUp, preSymbol, nextSymbol } = config; let number = formatMoney(data, precision, thousand); - if(makeUp === false && number !== '0') { + if(makeUp === false && number !== '0' && number.indexOf('.') !== -1) { number = number.replace(/0*$/,'').replace(/\.$/,''); } let numberWidth = parseInt(width) - 16; // 减去默认的左右padding共计16px