Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/nfpPublic

Go Language Microsoft Excel™ Number Format Parser

License

NotificationsYou must be signed in to change notification settings

xuri/nfp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Build StatusCode CoverageGo Report Cardgo.devLicenses

Using NFP (Number Format Parser) you can get an Abstract Syntax Tree (AST) from Excel number format expression.

Installation

go get github.com/xuri/nfp

Example

package mainimport"github.com/xuri/nfp"funcmain() {ps:=nfp.NumberFormatParser()tokens:=ps.Parse("_(* #,##0.00_);_(* (#,##0.00);_(*\"-\"??_);_(@_)")println(p.PrettyPrint())}

Get AST

<Positive>      <RepeatsChar>    # <HashPlaceHolder>    <ThousandsSeparator>    ## <HashPlaceHolder>    0 <ZeroPlaceHolder>    . <DecimalPoint>    00 <ZeroPlaceHolder><Negative>      <RepeatsChar>    ( <Literal>    # <HashPlaceHolder>    , <ThousandsSeparator>    ## <HashPlaceHolder>    0 <ZeroPlaceHolder>    . <DecimalPoint>    00 <ZeroPlaceHolder>    ) <Literal><Zero>      <RepeatsChar>    - <Literal>    ?? <DigitalPlaceHolder><Text>    @ <TextPlaceHolder>

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. Seehttps://opensource.org/licenses/BSD-3-Clause.


[8]ページ先頭

©2009-2025 Movatter.jp