how to get currency2 value without including the currency symbol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 02:40 AM
Hello
i want to know how to get currency2 value without including the currency symbol
"EUR;10"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2024 02:35 AM
Well, if you use "current.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.
getCurrencyValue() returns the value in the original currency.
If you want it in your current currency, then use getValue. getDisplayValue might include the currency sign and "," so don't use it.
Now if you just want the numbers without the cents, you can do that by splitting the value into an array.
var newValue = value.split(".");
value = newValue[0]; //You end up with 157000.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 07:01 AM
Great, thank you! 😉
And for setting a field, like I have in this example,
For the first field, this is working correctly for me:
current.fieldName.setDisplayValue('EUR;'+Variable);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-05-2024 11:00 PM
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€.
If you need to set it based on some other currency, you can say current.price = "USD;1000";
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.