- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 11:34 PM
Is there a way to get round off the result after below code.
var count= gr.getRowCount();
while(gr.next())
{
totalAttendance = totalAttendance + gr.u_count;
}
data.wholeCount= totalAttendance /count;
As of now I am getting the result in a decimal form.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 11:39 PM
Hi Kinston,
Just use Math.round to get round off result.
var count= gr.getRowCount();
while(gr.next())
{
totalAttendance = totalAttendance + gr.u_count;
}
data.wholeCount= Math.round(totalAttendance/count);
Please mark correct/helpful if applicable.
Regards,
Shubham
Shubham Tipnis
ServiceNow Enthusiast
⭐️ 3x Rising Star (2022–2024) – ServiceNow Community
Sharing insights, use cases & real-world learnings from the Now Platform
Always learning. Always building.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2022 11:39 PM
Hi Kinston,
Just use Math.round to get round off result.
var count= gr.getRowCount();
while(gr.next())
{
totalAttendance = totalAttendance + gr.u_count;
}
data.wholeCount= Math.round(totalAttendance/count);
Please mark correct/helpful if applicable.
Regards,
Shubham
Shubham Tipnis
ServiceNow Enthusiast
⭐️ 3x Rising Star (2022–2024) – ServiceNow Community
Sharing insights, use cases & real-world learnings from the Now Platform
Always learning. Always building.