inherit
170346
0
Mar 1, 2016 12:53:37 GMT -8
Shorty
Yeah, I'm that cool. Lol! No I'm not.
3,018
August 2011
shortyverrett94
|
Post by Shorty on Jun 14, 2012 12:31:18 GMT -8
So just playing I'm writing this code. And in it. I have 2 variables that are each a width. A width of a table. and a width of an image. i need the width of the table minus the image width. and then i need the result of that divided by 2. and then multiplied by a percent. how is this done? What i have is this:
var fdivWdth = (tblWdth-divCimgwdth); var sdivWdth = (fdivWdth/2); var scrlWdth = (sdivWdth*92%);
would this work? The red i'm thinking is wrong. thank you. I'm not sure because isn't the percent sign something other than percents? If its not right, how would i do it. Thank you
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Jun 14, 2012 15:58:38 GMT -8
So just playing I'm writing this code. And in it. I have 2 variables that are each a width. A width of a table. and a width of an image. i need the width of the table minus the image width. and then i need the result of that divided by 2. and then multiplied by a percent. how is this done? What i have is this: var fdivWdth = (tblWdth-divCimgwdth); var sdivWdth = (fdivWdth/2); var scrlWdth = (sdivWdth*92%);would this work? The red i'm thinking is wrong. thank you. I'm not sure because isn't the percent sign something other than percents? If its not right, how would i do it. Thank you Multiply by a decimal: 20 * 100% = 20*1 20 * 50% = 20*.5 20 * 25% = 20*.25
|
|
inherit
170346
0
Mar 1, 2016 12:53:37 GMT -8
Shorty
Yeah, I'm that cool. Lol! No I'm not.
3,018
August 2011
shortyverrett94
|
Post by Shorty on Jun 14, 2012 16:50:41 GMT -8
ah okay. so the rest is okay too?
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Jun 14, 2012 17:36:53 GMT -8
It all looks good, however you don't need the parentheses around each statement. var fdivWdth = tblWdth-divCimgwdth; is perfectly valid.
|
|
inherit
170346
0
Mar 1, 2016 12:53:37 GMT -8
Shorty
Yeah, I'm that cool. Lol! No I'm not.
3,018
August 2011
shortyverrett94
|
Post by Shorty on Jun 14, 2012 19:05:00 GMT -8
ah alright. thanks.
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Jun 14, 2012 19:05:22 GMT -8
No problem
|
|