diff options
author | Thomas Charbonnel <thomascharbonnel@users.noreply.github.com> | 2022-08-11 00:20:48 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 00:20:48 +0800 |
commit | ed91cddea59ce15da87ab744ac20b465a36ed5ef (patch) | |
tree | 1ab4a75b5a903e20253a93393bc9561bb86ed186 /sheet.go | |
parent | b8ceaf7bf61daecad8717abec90a8e0badb64806 (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.go | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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. // |