
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 04:37 AM
Logic has been written to calculate Days open field where 86400 is seconds for 1 day.
where math.floor is rounding off to 209.0
How can i remove this 0, what changes should be done in script.
Issue Details:
I'd like the "Days Open" field to only be integers and stop putting the additional .0 after the values. We don't use it.
I also want to ensure this number field is able to be sorted appropriately and actually do numerical order smaller to largest and vice versa. Right now, if I try to sort cases on Days Open they won't go in numerical order and go off the front number regardless of how high the number is (e.g., 209.0, 21.0, 211.0, 2112.0, 214.0).
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 06:28 AM
Oh..okay, then may be you can use split method to get the value befor decimal point.
else
{
open1 = open1.toString().split('.'); // split with .
ffi1.u_days_open = open1[0];
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 04:46 AM
Hi Chalan,
You can try below
else
{
ffi1.u_days_open = open1.toFixed(0);
}
Thanks and regards
Swamy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 06:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 06:28 AM
Oh..okay, then may be you can use split method to get the value befor decimal point.
else
{
open1 = open1.toString().split('.'); // split with .
ffi1.u_days_open = open1[0];
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-14-2017 07:47 AM
Hi Amaradi,
thank you for your time and it was really helpfull.
Note: Please provide some good link to learn all this basic stuffs.
Regards,
chalan