<?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 What is the most elegant way to convert from float to currency in SPL? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-elegant-way-to-convert-from-float-to-currency/m-p/483392#M193330</link>
    <description>&lt;P&gt;Miraculously in 2020 there still hasn't been a Splunk Answer that details an elegant way to convert from float to currency.&lt;/P&gt;

&lt;P&gt;Is this the best possible solution, or are there more elegant ways to do this? Careful of negative numbers.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval budget_amount="$".tostring(budget_amount,"commas") | rex mode=sed field=budget_amount "s/\$$-/-$$/g"&lt;/CODE&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2020 23:29:51 GMT</pubDate>
    <dc:creator>nick405060</dc:creator>
    <dc:date>2020-02-26T23:29:51Z</dc:date>
    <item>
      <title>What is the most elegant way to convert from float to currency in SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-elegant-way-to-convert-from-float-to-currency/m-p/483392#M193330</link>
      <description>&lt;P&gt;Miraculously in 2020 there still hasn't been a Splunk Answer that details an elegant way to convert from float to currency.&lt;/P&gt;

&lt;P&gt;Is this the best possible solution, or are there more elegant ways to do this? Careful of negative numbers.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;eval budget_amount="$".tostring(budget_amount,"commas") | rex mode=sed field=budget_amount "s/\$$-/-$$/g"&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 23:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-elegant-way-to-convert-from-float-to-currency/m-p/483392#M193330</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2020-02-26T23:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most elegant way to convert from float to currency in SPL?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-elegant-way-to-convert-from-float-to-currency/m-p/483393#M193331</link>
      <description>&lt;P&gt;How about:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval budget_amount=if(budget_amount&amp;gt;=0,"$".tostring(budget_amount,"commas"), "-$".tostring(abs(budget_amount),"commas"))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Feb 2020 15:21:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-elegant-way-to-convert-from-float-to-currency/m-p/483393#M193331</guid>
      <dc:creator>spayneort</dc:creator>
      <dc:date>2020-02-27T15:21:53Z</dc:date>
    </item>
  </channel>
</rss>

