
- 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 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 07:45 AM
As soon as I know that we both are working on same thread, I will loose hopes on points

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 07:52 AM
This one was low hanging fruit.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2016 08:04 AM
Let me know if that answered your question. If so, please mark it as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list. Thank you