<?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 how to get currency2 value without including the currency symbol in SPM forum</title>
    <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815134#M41885</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;i want to know how to get currency2 value without including the currency symbol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"EUR;10"&lt;/P&gt;</description>
    <pubDate>Mon, 05 Feb 2024 10:40:24 GMT</pubDate>
    <dc:creator>daikhi haithem</dc:creator>
    <dc:date>2024-02-05T10:40:24Z</dc:date>
    <item>
      <title>how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815134#M41885</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;i want to know how to get currency2 value without including the currency symbol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"EUR;10"&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 10:40:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815134#M41885</guid>
      <dc:creator>daikhi haithem</dc:creator>
      <dc:date>2024-02-05T10:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815145#M41886</link>
      <description>&lt;P&gt;Depending on the context you could do some other things, but just for that example lets say your currency is stored in variable "currency".&lt;BR /&gt;You could just try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var currency = "EUR;10";
var price = currency.split(";")[1];

gs.info(price);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Here we have the currency value stored in a variable and we use split(";") to create an array or currency where each value is separated by the semicolon. This results in an array like ["EUR","10"]. By adding [1] we tell that we want the value in second index, which would be the actual numerical price.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If you have a currency symbol in the resulting value, you can also use .&lt;SPAN&gt;substring&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;) to remove the first character.&lt;BR /&gt;So for example €10 would become 10.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 10:47:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815145#M41886</guid>
      <dc:creator>Weird</dc:creator>
      <dc:date>2024-02-05T10:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815299#M41888</link>
      <description>&lt;P&gt;I thought there was a JavaScript method to do it directly because I'm looking for the best practice to build my code&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 12:14:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815299#M41888</guid>
      <dc:creator>daikhi haithem</dc:creator>
      <dc:date>2024-02-05T12:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815407#M41890</link>
      <description>&lt;P&gt;Well, it depends on how you're getting the price. I assumed you had the currency as a string, but if you have the currency field, then there are few things you can do.&lt;BR /&gt;Below's a list of scripts and their results.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Price 88USD and script run as user who sees euros.
current.price: 80.86
current.price.getReferenceCurrencyCode(): USD
current.price.getReferenceDisplayValue(): USD88.00
current.price.getReferenceValue(): 88
current.price.getSessionCurrencyCode(): EUR
current.price.getSessionDisplayValue(): €80.86
current.price.getSessionValue(): 80.86
current.price.getCurrencyCode(): USD
current.price.getCurrencyDisplayValue(): USD88.00
current.price.getCurrencyString(): EUR;80.86
current.price.getCurrencyValue(): 88&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 13:12:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815407#M41890</guid>
      <dc:creator>Weird</dc:creator>
      <dc:date>2024-02-05T13:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815565#M41892</link>
      <description>&lt;P&gt;Great, thank you! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And for setting a field, like I have in this example,&lt;/P&gt;&lt;P&gt;For the first field, this is working correctly for me:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;current.fieldName.setDisplayValue(&lt;/SPAN&gt;&lt;SPAN&gt;'EUR;'&lt;/SPAN&gt;&lt;SPAN&gt;+Variable);&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;Is it the same thing for the second field?&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="coooooooooooo.png" style="width: 712px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/327189iEC3E1F54080ECC25/image-size/large?v=v2&amp;amp;px=999" role="button" title="coooooooooooo.png" alt="coooooooooooo.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2024 15:01:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2815565#M41892</guid>
      <dc:creator>daikhi haithem</dc:creator>
      <dc:date>2024-02-05T15:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2816327#M41906</link>
      <description>&lt;P&gt;The price is set based on your currency if you say, for example, current.price = 1000; and you're using euros it would become 1000€.&lt;BR /&gt;If you need to set it based on some other currency, you can say current.price = "USD;1000";&lt;BR /&gt;&lt;BR /&gt;So in your case I'd assume using "USD;1000" in a script would set the field to 1000 USD and show it as some amount of EUR in your session.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 07:00:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/2816327#M41906</guid>
      <dc:creator>Weird</dc:creator>
      <dc:date>2024-02-06T07:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/3015617#M44247</link>
      <description>&lt;P&gt;Hello....&lt;/P&gt;&lt;P&gt;can you elaborate on this method, like i have a table accounts with a field 1-30 which is a 'FX CURRENCY' type and contains values like $157,000 ...... etc , now i want to display this value in a vertical bar component but cant pass this value to it.......i tried doing&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; acc = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideRecord&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;(input.table);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; gDotWalking = acc.getDisplayValue(&lt;/SPAN&gt;&lt;SPAN&gt;'u_1_30'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"assignment_group"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"Current"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// "value": acc.getValue('current')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"value"&lt;/SPAN&gt;&lt;SPAN&gt;: gDotWalking&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;now this returns me this result&lt;BR /&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"assignment_group"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"Current"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"value"&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"$157,500.00"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;},&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;and i want to get the result as = "value" : 157500&lt;BR /&gt;&lt;BR /&gt;can you help me with the code or approach to get this result.&lt;BR /&gt;Thank You.&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Aug 2024 11:01:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/3015617#M44247</guid>
      <dc:creator>yuvrajsharrma</dc:creator>
      <dc:date>2024-08-12T11:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to get currency2 value without including the currency symbol</title>
      <link>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/3020661#M44329</link>
      <description>&lt;P&gt;Well, if you use "current&lt;SPAN&gt;.price.getCurrencyValue()", you'd end up with 157000,00. Or you should end up with the same if you use "current.getValue("price")" depending on your session currency.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;getCurrencyValue() returns the value in the original currency.&lt;BR /&gt;If you want it in your current currency, then use getValue. getDisplayValue might include the currency sign and "," so don't use it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now if you just want the numbers without the cents, you can do that by splitting the value into an array.&lt;BR /&gt;var newValue = value.split(".");&lt;BR /&gt;value = newValue[0]; //You end up with 157000.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2024 09:35:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/spm-forum/how-to-get-currency2-value-without-including-the-currency-symbol/m-p/3020661#M44329</guid>
      <dc:creator>Weird</dc:creator>
      <dc:date>2024-08-18T09:35:34Z</dc:date>
    </item>
  </channel>
</rss>

