Skip to content

Commit 4aebf92

Browse files
committed
fix bug
1 parent bb64ab5 commit 4aebf92

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/global/setdata.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ function setcellvalue(r, c, d, v) {
174174
else{
175175
if(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)){
176176

177-
177+
if(typeof vupdate === "string"){
178+
let flag = vupdate.split("").every(ele=>ele == "0" || ele == ".");
179+
if(flag){
180+
vupdate = parseFloat(vupdate);
181+
}
182+
}
178183
cell.v = vupdate; /* 备注:如果使用parseFloat,1.1111111111111111会转换为1.1111111111111112 ? */
179184
cell.ct = { "fa": "General", "t": "n" };
180185
if(cell.v == Infinity || cell.v == -Infinity){

0 commit comments

Comments
 (0)