Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func (c *Cell) SetValue(n interface{}) {
switch t := n.(type) {
case time.Time:
c.SetDateTime(t)
case int, int8, int16, int32, int64:
case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:
c.SetNumeric(fmt.Sprintf("%d", n))
case float64:
// When formatting floats, do not use fmt.Sprintf("%v", n), this will cause numbers below 1e-4 to be printed in
Expand Down
12 changes: 8 additions & 4 deletions write.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ func (r *Row) WriteSlice(e interface{}, cols int) int {
}
default:
switch val.Kind() { // underlying type of slice
case reflect.String, reflect.Int, reflect.Int8,
reflect.Int16, reflect.Int32, reflect.Int64, reflect.Float64, reflect.Float32:
case reflect.String,
reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
reflect.Float64, reflect.Float32:
cell := r.AddCell()
cell.SetValue(val.Interface())
case reflect.Bool:
Expand Down Expand Up @@ -153,8 +155,10 @@ func (r *Row) WriteStruct(e interface{}, cols int) int {
}
default:
switch f.Kind() {
case reflect.String, reflect.Int, reflect.Int8,
reflect.Int16, reflect.Int32, reflect.Int64, reflect.Float64, reflect.Float32:
case reflect.String,
reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
reflect.Float64, reflect.Float32:
cell := r.AddCell()
cell.SetValue(f.Interface())
case reflect.Bool:
Expand Down