[ 
https://issues.apache.org/jira/browse/NIFI-3149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Matt Burgess updated NIFI-3149:
-------------------------------
    Description: 
Currently using "${literal(\-5.5):toNumber()" will result in an anltr parsing 
exception due to '-' not being handled in the Lexer[1]. 

In the ANTLR lexer, "+" and "-" should be added a potential values at the 
beginning of a WHOLE_NUMBER  or DECIMAL.

A workaround is to place the number in quotes: ${literal("-5.5"):toNumber()


[1] 
https://github.com/apache/nifi/blob/master/nifi-commons/nifi-expression-language/src/main/antlr3/org/apache/nifi/attribute/expression/language/antlr/AttributeExpressionLexer.g#L80-L80

  was:
Currently using "${literal(-5.5):toNumber()" will result in an anltr parsing 
exception due to '-' not being handled in the Lexer[1]. 

In the ANTLR lexer, "+" and "-" should be added a potential values at the 
beginning of a WHOLE_NUMBER  or DECIMAL.

A workaround is to place the number in quotes: ${literal("-5.5"):toNumber()


[1] 
https://github.com/apache/nifi/blob/master/nifi-commons/nifi-expression-language/src/main/antlr3/org/apache/nifi/attribute/expression/language/antlr/AttributeExpressionLexer.g#L80-L80


> Expression Language should support passing negative numbers as literals
> -----------------------------------------------------------------------
>
>                 Key: NIFI-3149
>                 URL: https://issues.apache.org/jira/browse/NIFI-3149
>             Project: Apache NiFi
>          Issue Type: Improvement
>            Reporter: Joseph Percivall
>            Assignee: Joseph Percivall
>            Priority: Trivial
>
> Currently using "${literal(\-5.5):toNumber()" will result in an anltr parsing 
> exception due to '-' not being handled in the Lexer[1]. 
> In the ANTLR lexer, "+" and "-" should be added a potential values at the 
> beginning of a WHOLE_NUMBER  or DECIMAL.
> A workaround is to place the number in quotes: ${literal("-5.5"):toNumber()
> [1] 
> https://github.com/apache/nifi/blob/master/nifi-commons/nifi-expression-language/src/main/antlr3/org/apache/nifi/attribute/expression/language/antlr/AttributeExpressionLexer.g#L80-L80



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to