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
16 changes: 0 additions & 16 deletions cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,22 +509,6 @@ func (c *Cell) GetNumberFormat() string {
return c.NumFmt
}

func (c *Cell) formatToFloat(format string) (string, error) {
f, err := strconv.ParseFloat(c.Value, 64)
if err != nil {
return c.Value, err
}
return fmt.Sprintf(format, f), nil
}

func (c *Cell) formatToInt(format string) (string, error) {
f, err := strconv.ParseFloat(c.Value, 64)
if err != nil {
return c.Value, err
}
return fmt.Sprintf(format, int(f)), nil
}

// getNumberFormat will update the parsedNumFmt struct if it has become out of date, since a cell's NumFmt string is a
// public field that could be edited by clients.
func (c *Cell) getNumberFormat() *parsedNumberFormat {
Expand Down
14 changes: 2 additions & 12 deletions cell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ func TestCell(t *testing.T) {
smallDate := time.Date(1899, 12, 30, 0, 0, 0, 1000, time.UTC)
smallExcelTime := TimeToExcelTime(smallDate, false)

c.Assert(true, qt.Equals, 0.0 != smallExcelTime)
c.Assert(0.0, qt.Not(qt.Equals), smallExcelTime)
roundTrippedDate := TimeFromExcelTime(smallExcelTime, false)
c.Assert(roundTrippedDate, qt.Equals, smallDate)
})
Expand Down Expand Up @@ -933,16 +933,6 @@ func (fvc *formattedValueChecker) Equals(cell Cell, expected string) {
fvc.c.Assert(val, qt.Equals, expected)
}

func cellsFormattedValueEquals(t *testing.T, cell *Cell, expected string) {
val, err := cell.FormattedValue()
if err != nil {
t.Error(err)
}
if val != expected {
t.Errorf("Expected cell.FormattedValue() to be %v, got %v", expected, val)
}
}

func TestCellMerge(t *testing.T) {
c := qt.New(t)
csRunO(c, "MergeAndSave", func(c *qt.C, option FileOption) {
Expand All @@ -956,7 +946,7 @@ func TestCellMerge(t *testing.T) {
cell := row.AddCell()
cell.Value = "test"
cell.Merge(1, 0)
path := filepath.Join(c.Mkdir(), "merged.xlsx")
path := filepath.Join(t.TempDir(), "merged.xlsx")
err = f.Save(path)
c.Assert(err, qt.Equals, nil)
})
Expand Down
Loading
Loading