Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(format of formula cell bug fix): if cell has format , it is no ef…
Browse files Browse the repository at this point in the history
…fect
  • Loading branch information
tubiaoge committed Aug 13, 2020
1 parent 100166c commit 1f6ebad
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/global/setdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ function setcellvalue(r, c, d, v) {
else{
if(cell.f != null && isRealNum(vupdate) && !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(vupdate)){
cell.v = parseFloat(vupdate);
cell.ct = { "fa": "General", "t": "n" };
if(cell.ct==null){
cell.ct = { "fa": "General", "t": "n" };
}

if(cell.v == Infinity || cell.v == -Infinity){
cell.m = cell.v.toString();
Expand All @@ -92,9 +94,17 @@ function setcellvalue(r, c, d, v) {
cell.m = cell.v.toExponential(len).toString();
}
else{
let mask = genarate(Math.round(cell.v * 1000000000) / 1000000000);
let v_p = Math.round(cell.v * 1000000000) / 1000000000;
if(cell.ct==null){
let mask = genarate(v_p);
cell.m = mask[0].toString();
}
else{
let mask = update(cell.ct.fa, v_p);
cell.m = mask.toString();
}

cell.m = mask[0].toString();
// cell.m = mask[0].toString();
}
}
}
Expand Down

0 comments on commit 1f6ebad

Please sign in to comment.