<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Using math function methods in NiFi in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Using-math-function-methods-in-NiFi/m-p/368726#M240244</link>
    <description>&lt;P class="p1"&gt;Hello NiFi Community,&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;I want to convert decimal degree coordinates (e.g. -45.123658) to radians, and I want to use the built-in NiFi math function to do so.&amp;nbsp; However, simply following the simple example in the Expression Language documentation for math, the example fails.&amp;nbsp; I keep getting an "unexpected token" error whenever trying to use toDouble or the math function itself.&amp;nbsp; Anyone have any success with using the math function and any of the methods associated with it, particularly if they take a double as an argument?&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Since the function is subjectless, I'm :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;${math("toRadians", ${latitude:toDouble()})}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I've also tried variations of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;${latitude:toDouble():math("toRadians", ${latitude})}&lt;/LI-CODE&gt;&lt;LI-CODE lang="java"&gt;${latitude:math("toRadians", ${latitude:toDouble()})}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any insight.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Apr 2023 19:28:29 GMT</pubDate>
    <dc:creator>ChuckE</dc:creator>
    <dc:date>2023-04-17T19:28:29Z</dc:date>
    <item>
      <title>Using math function methods in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Using-math-function-methods-in-NiFi/m-p/368726#M240244</link>
      <description>&lt;P class="p1"&gt;Hello NiFi Community,&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;I want to convert decimal degree coordinates (e.g. -45.123658) to radians, and I want to use the built-in NiFi math function to do so.&amp;nbsp; However, simply following the simple example in the Expression Language documentation for math, the example fails.&amp;nbsp; I keep getting an "unexpected token" error whenever trying to use toDouble or the math function itself.&amp;nbsp; Anyone have any success with using the math function and any of the methods associated with it, particularly if they take a double as an argument?&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Since the function is subjectless, I'm :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;${math("toRadians", ${latitude:toDouble()})}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I've also tried variations of:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;${latitude:toDouble():math("toRadians", ${latitude})}&lt;/LI-CODE&gt;&lt;LI-CODE lang="java"&gt;${latitude:math("toRadians", ${latitude:toDouble()})}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate any insight.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 19:28:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Using-math-function-methods-in-NiFi/m-p/368726#M240244</guid>
      <dc:creator>ChuckE</dc:creator>
      <dc:date>2023-04-17T19:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using math function methods in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Using-math-function-methods-in-NiFi/m-p/368729#M240247</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you try the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${latitude:toDecimal():math("toRadians")}&lt;/LI-CODE&gt;&lt;P&gt;Or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;${latitude:math("toRadians")}&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 17 Apr 2023 20:18:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Using-math-function-methods-in-NiFi/m-p/368729#M240247</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-04-17T20:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using math function methods in NiFi</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Using-math-function-methods-in-NiFi/m-p/368732#M240250</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;.&amp;nbsp; I can always count on you to respond with good ideas.&amp;nbsp; It didn't occur to me to include just a single parameter in the math function because the documentation shows using "scalb" and "pow" methods with the second parameter as the value to pass to the input method. But also, I was trying to use a Double because they documentation says "toRadians" only accepts a double, and the NiFi expression language docs shows using a "toDouble()", but "toDouble" doesn't seem to be supported.&amp;nbsp; Seems to be an inconsistency in the docs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your suggestions were pretty close.&amp;nbsp; Below is the final result which did the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;${latitude:toDecimal():math("toRadians")}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 21:29:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Using-math-function-methods-in-NiFi/m-p/368732#M240250</guid>
      <dc:creator>ChuckE</dc:creator>
      <dc:date>2023-04-17T21:29:58Z</dc:date>
    </item>
  </channel>
</rss>

