https://github.com/xuri/nfp
Go Language Microsoft Excel™ Number Format Parser
https://github.com/xuri/nfp
ast ecma-376 excel excelize go golang lexer number-format number-formating parser spreadsheet
Last synced: about 2 months ago
JSON representation
Go Language Microsoft Excel™ Number Format Parser
- Host: GitHub
- URL: https://github.com/xuri/nfp
- Owner: xuri
- License: bsd-3-clause
- Created: 2022-02-04T16:36:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T14:58:37.000Z (3 months ago)
- Last Synced: 2025-03-29T08:04:52.643Z (2 months ago)
- Topics: ast, ecma-376, excel, excelize, go, golang, lexer, number-format, number-formating, parser, spreadsheet
- Language: Go
- Homepage: https://xuri.me/excelize
- Size: 54.7 KB
- Stars: 19
- Watchers: 10
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# NFP (Number Format Parser)
[](https://github.com/xuri/nfp/actions?workflow=Go)
[](https://codecov.io/gh/xuri/nfp)
[](https://goreportcard.com/report/github.com/xuri/nfp)
[](https://pkg.go.dev/github.com/xuri/nfp)
[](https://opensource.org/licenses/BSD-3-Clause)Using NFP (Number Format Parser) you can get an Abstract Syntax Tree (AST) from Excel number format expression.
## Installation
```bash
go get github.com/xuri/nfp
```## Example
```go
package mainimport "github.com/xuri/nfp"
func main() {
ps := nfp.NumberFormatParser()
tokens := ps.Parse("_(* #,##0.00_);_(* (#,##0.00);_(* \"-\"??_);_(@_)")
println(p.PrettyPrint())
}
```Get AST
```text
#
##
0
.
00
(
#
,
##
0
.
00
)
-
??@
```## Contributing
Contributions are welcome! Open a pull request to fix a bug, or open an issue to discuss a new feature or change.
## Licenses
This program is under the terms of the BSD 3-Clause License. See [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause).