Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Integration / Customization
IPA/ProcessFlow
javascript line
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
Starr
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5327
People Online:
Visitors:
266
Members:
0
Total:
266
Online Now:
New Topics
S3 Systems Administration
Lawson Security Admin (LSA) - Securing Print Manager to self only
10/24/2025 6:27 PM
Looking for someone who would be willing to share
Lawson Add-Ins for Microsoft Office
Lawson Add-in
9/30/2025 6:51 PM
I am looking for a Lawson Add-ins query to add new
Lawson S3 Procurement
Anyone getting PO 0000 not found for company error in PO23?
9/30/2025 2:45 AM
Anyone getting PO 0000 not found for company error
Lawson Add-Ins for Microsoft Office
PO20 - Cancel PO via Add-in
9/25/2025 8:03 PM
Is it possible to cancel PO's using add-ins? I
S3 Systems Administration
S3 Payroll - PayStubs
9/18/2025 6:58 PM
Looking for a reliable solution to streamline the
S3 Systems Administration
Quick Access report
8/25/2025 7:17 PM
Looking for a good way to see who has access Lawso
S3 Customization/Development
LP01 hiding a PTO plan from the list
8/13/2025 4:44 PM
Hi all. is there a way to hide a specific PTO&n
Lawson Business Intelligence/Reporting/Crystal
GLTrans - PO Line/MAInvdtl
8/6/2025 6:13 PM
Hello, we have an existing tabular model for fina
IPA/ProcessFlow
Retrieving GUID from InforOS
7/25/2025 2:22 AM
Hello everyone, I was wondering if there is a way
IPA/ProcessFlow
IPA for forwarding cost messages (MA64/MA66.3)
7/23/2025 6:07 PM
When a buyer has an invoice cost message where the
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3293
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1377
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Integration / Customization
IPA/ProcessFlow
javascript line
Please
login
to post a reply.
4 Replies
0
Subscribed to this topic
52 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
TommyT
Veteran Member
Posts: 58
3/1/2011 1:05 PM
Im having trouble with a piece of java_script....it needs one more line
dcell= "+" + addLeadingZeros(dcell,12);
if (DED_DED_AMT< 0 ){
dcell = DED_DED_AMT;
dcell= "-" + addLeadingZeros(dcell,12);
}
I need to display numbers in a format of +000000001.23.
Certain numbers will be negative and need to be displayed as -00000001.23
The code does everything right except when a number is negative it
is displaying -0000000-1.23
Can anyone help me with the line or 2 of code I need?
Robert Spurr
Veteran Member
Posts: 130
3/1/2011 3:51 PM
Split
I think what you are doing is correct except that once you have determined the amount to be negative you need to convert it to a postive number before adding the zeros.
dcell = DED_DED_AMT * -1;
Hope this helps.
George Graham
Veteran Member
Posts: 201
3/1/2011 7:08 PM
Split
You could also use the absolute function - abs().
TommyT
Veteran Member
Posts: 58
3/1/2011 7:38 PM
Split
I tried that and got -10.00 (no padding) on my line.
Robert Spurr
Veteran Member
Posts: 130
3/1/2011 8:52 PM
Split
I did a quick test in Design Studio to be sure and the example below returned the results you desire. (-000000010.45)
Hope this Helps.
var dblNegative = -10.45;
var dblPositive = dblNegative * -1;
dblPostive = "-" + addLeadingZeros(dblPositive,12);
function addLeadingZeros(number,length)
{
var str = '' + number;
while (str.length < length)
{
str = '0' + str;
}
return str;
}
Please
login
to post a reply.