jquery-table2excel icon indicating copy to clipboard operation
jquery-table2excel copied to clipboard

消除科学计数

Open yudaobin opened this issue 6 years ago • 1 comments

比如身份号,excel怎么消除科学计数法,只展示字符串?

yudaobin avatar Dec 21 '18 05:12 yudaobin

js文件里这段判断一下,字段长度和是否为纯数字

if (rc.rows & rc.cols) { if ($(q).html().length > 11 && !isNaN($(q).html())) { tempRows += "

" + $(q).html() + ""; } else { tempRows += "" + $(q).html() + ""; }
} else { if ($(q).html().length > 11 && !isNaN($(q).html())) { tempRows += "<td style='mso-number-format:"\@"'"; } else { tempRows += "<td"; } if( rc.rows > 0) { tempRows += " rowspan='" + rc.rows + "' "; } if( rc.cols > 0) { tempRows += " colspan='" + rc.cols + "' "; } tempRows += "/>" + $(q).html() + ""; }

mouqianxi avatar Jun 18 '21 03:06 mouqianxi