-
According to docs the However I always get "general" as cell's type\format. How to you set it to text or any other type explicitly? example from my project:
|
Beta Was this translation helpful? Give feedback.
Answered by
konart
Dec 4, 2023
Replies: 1 comment
-
To answer my own question: this is done via cell, err := excelize.JoinCellName(cname, rowNum)
if err != nil {
return err
}
s, err := file.NewStyle(&excelize.Style{NumFmt: textNumberFormat})
if err != nil {
return err
}
if err := file.SetCellStyle(sheetName, cell, cell, s); err != nil {
return err
}
if err := file.SetCellValue(sheetName, cell, elements[i]); err != nil {
return err
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
konart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To answer my own question: this is done via
SetCellStyle()
method like so:https://xuri.me/excelize/en/style.html#number_format