number类型

This commit is contained in:
huayj 2019-08-26 21:12:36 +08:00
parent f516bf2147
commit 963a9821ae
1 changed files with 1 additions and 1 deletions

View File

@ -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