summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
authorThomas Charbonnel <thomascharbonnel@users.noreply.github.com>2022-08-11 00:20:48 +0800
committerGitHub <noreply@github.com>2022-08-11 00:20:48 +0800
commited91cddea59ce15da87ab744ac20b465a36ed5ef (patch)
tree1ab4a75b5a903e20253a93393bc9561bb86ed186 /sheet.go
parentb8ceaf7bf61daecad8717abec90a8e0badb64806 (diff)
This closes #1296, add new function `GetRowOpts` for stream reader (#1297)
- Support get rows properties by `GetRowOpts` function - New exported constant `MaxCellStyles`
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/sheet.go b/sheet.go
index 01dd167..1f2dcea 100644
--- a/sheet.go
+++ b/sheet.go
@@ -928,6 +928,34 @@ func attrValToInt(name string, attrs []xml.Attr) (val int, err error) {
return
}
+// attrValToFloat provides a function to convert the local names to a float64
+// by given XML attributes and specified names.
+func attrValToFloat(name string, attrs []xml.Attr) (val float64, err error) {
+ for _, attr := range attrs {
+ if attr.Name.Local == name {
+ val, err = strconv.ParseFloat(attr.Value, 64)
+ if err != nil {
+ return
+ }
+ }
+ }
+ return
+}
+
+// attrValToBool provides a function to convert the local names to a boolean
+// by given XML attributes and specified names.
+func attrValToBool(name string, attrs []xml.Attr) (val bool, err error) {
+ for _, attr := range attrs {
+ if attr.Name.Local == name {
+ val, err = strconv.ParseBool(attr.Value)
+ if err != nil {
+ return
+ }
+ }
+ }
+ return
+}
+
// SetHeaderFooter provides a function to set headers and footers by given
// worksheet name and the control characters.
//