rating as float
This commit is contained in:
@@ -181,7 +181,14 @@ func XLSX(r io.Reader, conf *Conf) (*ecalc.Ecalc, error) {
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
set.Field(&aspect, c.Field, cellValue)
|
||||
if cellValue == "" {
|
||||
continue
|
||||
}
|
||||
err = set.Field(&aspect, c.Field, cellValue)
|
||||
if err != nil {
|
||||
fmt.Println(shortName, c.Field, cellValue)
|
||||
fmt.Println(err)
|
||||
}
|
||||
}
|
||||
topic.Aspects = append(topic.Aspects, aspect)
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package loader
|
||||
import (
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"math"
|
||||
"testing"
|
||||
|
||||
"github.com/matryer/is"
|
||||
@@ -23,6 +24,9 @@ func TestXLSX(t *testing.T) {
|
||||
is.Equal(got.CompanyFacts.FinancialCosts, 12)
|
||||
is.Equal(got.CompanyFacts.EmployeesFractions[1].CountryCode, "AUT")
|
||||
|
||||
is.Equal(math.Round(got.CompanyFacts.Rating.Topics[0].Aspects[0].Points), math.Round(4))
|
||||
is.Equal(math.Round(got.CompanyFacts.Rating.Topics[0].Aspects[1].Points), math.Round(-9))
|
||||
|
||||
is.Equal(got.Matrix.Topics[0].ShortName, "A1")
|
||||
is.Equal(got.Matrix.Topics[0].MaxPoints, 44)
|
||||
is.Equal(got.Matrix.Topics[4].ShortName, "B1")
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user