@@ -523,7 +523,7 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
523
523
case CalcOperatorCountValues :
524
524
countValues := 0
525
525
for _ , row := range table .Rows {
526
- if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .content {
526
+ if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .Content {
527
527
countValues ++
528
528
}
529
529
}
@@ -532,9 +532,9 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
532
532
countUniqueValues := 0
533
533
uniqueValues := map [string ]bool {}
534
534
for _ , row := range table .Rows {
535
- if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .content {
536
- if ! uniqueValues [row .Cells [colIndex ].Value .Template .content ] {
537
- uniqueValues [row .Cells [colIndex ].Value .Template .content ] = true
535
+ if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .Content {
536
+ if ! uniqueValues [row .Cells [colIndex ].Value .Template .Content ] {
537
+ uniqueValues [row .Cells [colIndex ].Value .Template .Content ] = true
538
538
countUniqueValues ++
539
539
}
540
540
}
@@ -543,23 +543,23 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
543
543
case CalcOperatorCountEmpty :
544
544
countEmpty := 0
545
545
for _ , row := range table .Rows {
546
- if nil == row .Cells [colIndex ] || nil == row .Cells [colIndex ].Value || nil == row .Cells [colIndex ].Value .Template || "" == row .Cells [colIndex ].Value .Template .content {
546
+ if nil == row .Cells [colIndex ] || nil == row .Cells [colIndex ].Value || nil == row .Cells [colIndex ].Value .Template || "" == row .Cells [colIndex ].Value .Template .Content {
547
547
countEmpty ++
548
548
}
549
549
}
550
550
col .Calc .Result = & Value {Number : NewFormattedValueNumber (float64 (countEmpty ), NumberFormatNone )}
551
551
case CalcOperatorCountNotEmpty :
552
552
countNotEmpty := 0
553
553
for _ , row := range table .Rows {
554
- if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .content {
554
+ if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .Content {
555
555
countNotEmpty ++
556
556
}
557
557
}
558
558
col .Calc .Result = & Value {Number : NewFormattedValueNumber (float64 (countNotEmpty ), NumberFormatNone )}
559
559
case CalcOperatorPercentEmpty :
560
560
countEmpty := 0
561
561
for _ , row := range table .Rows {
562
- if nil == row .Cells [colIndex ] || nil == row .Cells [colIndex ].Value || nil == row .Cells [colIndex ].Value .Template || "" == row .Cells [colIndex ].Value .Template .content {
562
+ if nil == row .Cells [colIndex ] || nil == row .Cells [colIndex ].Value || nil == row .Cells [colIndex ].Value .Template || "" == row .Cells [colIndex ].Value .Template .Content {
563
563
countEmpty ++
564
564
}
565
565
}
@@ -569,7 +569,7 @@ func (table *Table) calcColTemplate(col *TableColumn, colIndex int) {
569
569
case CalcOperatorPercentNotEmpty :
570
570
countNotEmpty := 0
571
571
for _ , row := range table .Rows {
572
- if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .content {
572
+ if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Template && "" != row .Cells [colIndex ].Value .Template .Content {
573
573
countNotEmpty ++
574
574
}
575
575
}
@@ -969,16 +969,16 @@ func (table *Table) calcColNumber(col *TableColumn, colIndex int) {
969
969
}
970
970
}
971
971
case CalcOperatorMin :
972
- min := math .MaxFloat64
972
+ minVal := math .MaxFloat64
973
973
for _ , row := range table .Rows {
974
974
if nil != row .Cells [colIndex ] && nil != row .Cells [colIndex ].Value && nil != row .Cells [colIndex ].Value .Number && row .Cells [colIndex ].Value .Number .IsNotEmpty {
975
- if row .Cells [colIndex ].Value .Number .Content < min {
976
- min = row .Cells [colIndex ].Value .Number .Content
975
+ if row .Cells [colIndex ].Value .Number .Content < minVal {
976
+ minVal = row .Cells [colIndex ].Value .Number .Content
977
977
}
978
978
}
979
979
}
980
- if math .MaxFloat64 != min {
981
- col .Calc .Result = & Value {Number : NewFormattedValueNumber (min , col .NumberFormat )}
980
+ if math .MaxFloat64 != minVal {
981
+ col .Calc .Result = & Value {Number : NewFormattedValueNumber (minVal , col .NumberFormat )}
982
982
}
983
983
case CalcOperatorMax :
984
984
maxVal := - math .MaxFloat64
0 commit comments