
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 07:39 AM
I'm working on a way to properly bill customers for work done after hours and on holidays. In my table, I have a field of decimal type - u_hours_worked. When I look at a record in this table, I see the Hours Worked with 2 decimal places, but the actual value can contain many decimal points. When I try to display this field in a message, all decimal points are displayed - I want to round to 2 there as well.
I tried this but it is returning undefined and I've been unable to find another solution.
var myHours = current.u_hours_worked;
myHours = myHours.toFixed(2);
TIA!
Karla
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 07:42 AM
Hi Karla,
You might want to ensure it is a floating point number first.
var myHours = parseFloat(current.u_hours_worked);
myHours = myHours.toFixed(2);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 08:32 AM
Same here I almost stop looking community after 3.30 pm IST as Chuck comes at that time. Hardly we will find any question un answered after that

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 07:44 AM
Try this
var myHours = current.u_hours_worked;
myHours = parseFloat(myHours).toFixed(2);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 08:08 AM
You are both awesome and so quick - both methods worked, wish I could set them both as correct. I'm going to have to go with the fastest again today...