<?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>topic Macro Validation Expression Error? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272307#M2399</link>
    <description>&lt;P&gt;I made a macro, we'll call it "test" defined as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval new_rate=$val$*$rate$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with the validation expression just checking rate to make sure it's a number&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;isnum($rate$)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I call the macro.. I end up with something like &lt;CODE&gt;test(revenue, .79)&lt;/CODE&gt; When I do this, Splunk says my rate failed validation because .79 is considered a string. When I pass 0.79, it passes as expected. Is this intentional, or a bug? Additionally, is there a function that would pass .79 as a number?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Apr 2016 16:46:36 GMT</pubDate>
    <dc:creator>jluo_splunk</dc:creator>
    <dc:date>2016-04-01T16:46:36Z</dc:date>
    <item>
      <title>Macro Validation Expression Error?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272307#M2399</link>
      <description>&lt;P&gt;I made a macro, we'll call it "test" defined as&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; eval new_rate=$val$*$rate$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;with the validation expression just checking rate to make sure it's a number&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;isnum($rate$)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I call the macro.. I end up with something like &lt;CODE&gt;test(revenue, .79)&lt;/CODE&gt; When I do this, Splunk says my rate failed validation because .79 is considered a string. When I pass 0.79, it passes as expected. Is this intentional, or a bug? Additionally, is there a function that would pass .79 as a number?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 16:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272307#M2399</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2016-04-01T16:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Validation Expression Error?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272308#M2400</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;test(revenue, tonumber(.79))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Apr 2016 17:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272308#M2400</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-04-01T17:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Validation Expression Error?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272309#M2401</link>
      <description>&lt;P&gt;Wonderful, thank you woodcock!&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 22:03:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272309#M2401</guid>
      <dc:creator>jluo_splunk</dc:creator>
      <dc:date>2016-04-04T22:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Validation Expression Error?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272310#M2402</link>
      <description>&lt;P&gt;Note that I just retried all this in v6.5.0 and not only is &lt;CODE&gt;tonumber&lt;/CODE&gt; not necessary but it generates an error now (the same error that this solution was proposed to solve)!&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 20:33:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Macro-Validation-Expression-Error/m-p/272310#M2402</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-01-16T20:33:00Z</dc:date>
    </item>
  </channel>
</rss>

