Procházet zdrojové kódy

Better fix for #101 from @qiuly in #104.

Less code, same fix. Win.
Shawn Milochik před 10 roky
rodič
revize
a8a8c42e08
1 změnil soubory, kde provedl 2 přidání a 6 odebrání
  1. 2 6
      cell.go

+ 2 - 6
cell.go

@@ -194,16 +194,12 @@ func (c *Cell) formatToInt(format string) string {
 // Return the formatted version of the value.
 func (c *Cell) FormattedValue() string {
 	var numberFormat string = c.GetNumberFormat()
-	isText := numberFormat == "general" || numberFormat == "@"
-	if (c.Type() == CellTypeString) && isText {
-		return c.Value
-	}
 	switch numberFormat {
-	case "general":
+	case "general", "@":
 		return c.Value
 	case "0", "#,##0":
 		return c.formatToInt("%d")
-	case "0.00", "#,##0.00", "@":
+	case "0.00", "#,##0.00":
 		return c.formatToFloat("%.2f")
 	case "#,##0 ;(#,##0)", "#,##0 ;[red](#,##0)":
 		f, err := strconv.ParseFloat(c.Value, 64)