- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 09:49 PM
How do I format a currency field so that it displays 01000000 as $1,000,000.00
my code to display currently is
where cost is defined as a variable
I've looked at the server side script API and do not seem to be able to locate anything.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 11:30 PM
Hi Ian,
Replace line 15
as cost = equipment.cost. getCurrencyDisplayValue(); and you can remove line 16

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 10:40 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 10:47 PM
Use getDisplayValue() method. Like current.<your currency field name>.getDisplayValue()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 11:18 PM
Unfortunately in my case the value i'm displaying is derived by adding up multiple values, so the field/variable i'm wishing to display is not a field from a record but rather a variable that i've created in my method. Hope this makes sense. I've included the code snippet. I'm sure there probably is a simple answer, however i'm new to service now coding so still learning the API

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-03-2016 11:27 PM
Ian,
you can use something like this
var currency_code=equipment.cost.getCurrencyCode();
cost= cost+ equipment.cost.getCurrencyValue();
Finally you can append both currency code and value
var final_cost= currency_code+' '+cost;