Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
User Experience
Lawson Design Studio
Rounding numbers in Design Studio Portal Page Designer
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Jessica
Past 24 Hours:
2
Prev. 24 Hours:
0
Overall:
5164
People Online:
Visitors:
200
Members:
0
Total:
200
Online Now:
New Topics
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3288
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1348
Roger French
1311
mark.cook
1244
Forums
Unanswered
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Lawson Design Studio
Rounding numbers in Design Studio Portal Page Designer
Sort:
Oldest First
Most Recent First
You are not authorized to post a reply.
Author
Messages
Jill
Basic Member
Posts: 7
7/24/2009 1:22 PM
I'm trying to create a simple, little report in Portal Page Designer. It will be a listing showing managers their direct reports' vacation balances in EMSS.
How can I round a Lawson number field? Available Hours is stored in the database as 53.758834 -- so that's how it is displayed on my report. They want it rounded to 2 decimal places.
I'm guessing there is a straightforward way to do this. But I'm pretty new to Design Studio and JavaScript.
Thanks for the help!
TracyO
Veteran Member
Posts: 97
7/24/2009 1:33 PM
Jill
I had the same problem with my amounts, This should work for you:
/***************************************************************/
// New in process verson
function roundToPennies(n)
{
pennies = n * 100;
pennies = Math.round(pennies);
//pennies = pennies / 100 ;
strPennies = pennies;
return strPennies;
}
Gary Davies
Veteran Member
Posts: 248
7/24/2009 1:55 PM
That will work. There is a javascript function that already does this though called toFixed you use as such:
Total = Total.toFixed(2)
This rounds the variable Total to 2 decimals.
Jill
Basic Member
Posts: 7
7/24/2009 2:05 PM
Thanks! Both of those seem like simple enough JavaScript functions.
Follow-up (really) dump question...so, how do I call this function? My first attempt uses a Data Query block and the source contains NUGGLETS. Do I have to do the whole query in JavaScript to make formatting changes?
I warned you I was new to Design Studio and JavaScript!
Thanks for you help!
You are not authorized to post a reply.