|
|
@@ -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)
|