[ 
https://issues.apache.org/jira/browse/NIFI-11298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18085312#comment-18085312
 ] 

Daniel Stieglitz commented on NIFI-11298:
-----------------------------------------

[~pvillard] This is an older ticket. Is there still a need for this?

> Create EL format function for numbers
> -------------------------------------
>
>                 Key: NIFI-11298
>                 URL: https://issues.apache.org/jira/browse/NIFI-11298
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Pierre Villard
>            Priority: Minor
>
> Create an expression language allowing to format number for local 
> representations.
> [https://docs.oracle.com/javase/tutorial/java/data/numberformat.html]
> {code:java}
>       long n = 461012;
>       System.out.format("%d%n", n);      //  -->  "461012"
>       System.out.format("%08d%n", n);    //  -->  "00461012"
>       System.out.format("%+8d%n", n);    //  -->  " +461012"
>       System.out.format("%,8d%n", n);    // -->  " 461,012"
>       System.out.format("%+,8d%n%n", n); //  -->  "+461,012" 
>       double pi = Math.PI;
>       System.out.format("%f%n", pi);       // -->  "3.141593"
>       System.out.format("%.3f%n", pi);     // -->  "3.142"
>       System.out.format("%10.3f%n", pi);   // -->  "     3.142"
>       System.out.format("%-10.3f%n", pi);  // -->  "3.142"
>       System.out.format(Locale.FRANCE,
>                         "%-10.4f%n%n", pi); // -->  "3,1416"{code}
> The objective is to have the possibility to turn a number like 12345678.99999 
> into this string: 12,345,678.99.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to