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:
Wayne Willis
Past 24 Hours:
0
Prev. 24 Hours:
1
Overall:
5190
People Online:
Visitors:
241
Members:
0
Total:
241
Online Now:
New Topics
Lawson Landmark
Executing IPA from PR160
5/3/2024 2:46 PM
We're facing a situation where we need to upda
IPA/ProcessFlow
Executing IPA from PR160
5/3/2024 2:46 PM
We're facing a situation where we need to upda
S3 Customization/Development
Cobol - Extract Current Time
4/24/2024 7:21 PM
How do you extract just the Current System Time in
Lawson Landmark
LPL INSTR Functions
4/5/2024 8:32 PM
I'm writing a simple report using the Create R
Infor SCM
Translating 856 to get the ~ REF^CN^ field
4/3/2024 8:24 PM
We are trying to get the tracking number which is
IPA/ProcessFlow
Sample XML file create Flow
4/3/2024 3:43 PM
Hello everyone, I am new to creating XML files
Lawson S3 HR/Payroll/Benefits
bn105 error message
3/26/2024 6:40 PM
I need to change some of the set ups in our Life I
IPA/ProcessFlow
IPA executing Job
3/13/2024 7:08 PM
New to the IPA world and was wondering, can an IPA
Lawson S3 HR/Payroll/Benefits
Life Age Reduction on benefits plans
3/12/2024 7:15 PM
For our optional life we have an age based coverag
Lawson S3 HR/Payroll/Benefits
BN53.1 Add-In
3/7/2024 3:31 PM
We are migrating to Solstice. They require a
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
1354
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.