[英]How to put in the thousands separator in xlsx using xlsxwriter module?
When using xlsxwriter how do you get the xlsx file to contain columns with comma formatted numbers(not strings) in a column? 当使用xlsxwriter时,如何让xlsx文件包含列中带逗号格式的数字(而不是字符串)的列?
What I want to do - turn 1000 into 1,000 while preserving value as a number 我想做什么 -将1000变为1,000,同时保留价值作为数字
Failed attempts... 尝试失败......
#gives warning in cell (asking if it should be a number) + writes as string not number
sheet.write_string(0,0,re.sub("^0*|\.?0*$","",format(val, ',.10f')) )
# writes as number with no warning, but no commas
sheet.write_number(0,0,1000)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.