mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-10-13 03:33:50 +08:00
chore: 优化excel导入导出
This commit is contained in:
15
pkg/utils/excel/excel.go
Normal file
15
pkg/utils/excel/excel.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package excel
|
||||
|
||||
// 生成 Excel 中的列标签
|
||||
func GenerateColumnLabel(index int) string {
|
||||
|
||||
var columnLabel string
|
||||
|
||||
for index > 0 {
|
||||
mod := (index - 1) % 26
|
||||
columnLabel = string(rune('A'+mod)) + columnLabel
|
||||
index = (index - 1) / 26
|
||||
}
|
||||
|
||||
return columnLabel
|
||||
}
|
Reference in New Issue
Block a user