|
@@ -7,6 +7,7 @@ const REG2 = new RegExp('\r\n', 'g');
|
|
|
const REG3 = new RegExp('\n', 'g');
|
|
|
const REG4 = new RegExp('\r', 'g');
|
|
|
const REG5 = new RegExp('\t', 'g');
|
|
|
+const OFFSET_FLOAT = 0.0000000001;
|
|
|
|
|
|
const JpcCommonOutputHelper = {
|
|
|
createCommonOutputWithoutDecorate: function(node, value, forceCombine) {
|
|
@@ -57,10 +58,11 @@ const JpcCommonOutputHelper = {
|
|
|
},
|
|
|
formatCell: function(formatStr, rstCell) {
|
|
|
if (formatStr) {
|
|
|
- if (!(isNaN(parseFloat(rstCell[JV.PROP_VALUE])))) {
|
|
|
+ const rstCellFloatVal = parseFloat(rstCell[JV.PROP_VALUE]);
|
|
|
+ if (!(isNaN(rstCellFloatVal))) {
|
|
|
const dotIdx = formatStr.indexOf('.');
|
|
|
if (dotIdx >= 0) {
|
|
|
- let tmpStr = parseFloat(rstCell[JV.PROP_VALUE]).toFixed(formatStr.length - dotIdx - 1);
|
|
|
+ let tmpStr = (rstCellFloatVal + OFFSET_FLOAT).toFixed(formatStr.length - dotIdx - 1);
|
|
|
const digStr = formatStr.substr(dotIdx + 1, formatStr.length - dotIdx);
|
|
|
for (let sIdx = digStr.length - 1; sIdx >= 0; sIdx--) {
|
|
|
if (digStr[sIdx] === '#') {
|
|
@@ -76,7 +78,7 @@ const JpcCommonOutputHelper = {
|
|
|
if (tmpStr[tmpStr.length - 1] === '.') tmpStr = tmpStr.substr(0, tmpStr.length - 1);
|
|
|
rstCell[JV.PROP_VALUE] = tmpStr;
|
|
|
} else {
|
|
|
- rstCell[JV.PROP_VALUE] = parseFloat(rstCell[JV.PROP_VALUE]).toFixed(0);
|
|
|
+ rstCell[JV.PROP_VALUE] = (rstCellFloatVal + OFFSET_FLOAT).toFixed(0);
|
|
|
}
|
|
|
const commaIdx = formatStr.indexOf(',');
|
|
|
if (commaIdx >= 0) {
|