Click here to Skip to main content
15,892,199 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Ajax issue Pin
MacRaider416-Jan-12 9:48
MacRaider416-Jan-12 9:48 
GeneralRe: Ajax issue Pin
MacRaider417-Jan-12 1:59
MacRaider417-Jan-12 1:59 
GeneralRe: Ajax issue Pin
BobJanova17-Jan-12 3:59
BobJanova17-Jan-12 3:59 
GeneralRe: Ajax issue Pin
MacRaider417-Jan-12 4:12
MacRaider417-Jan-12 4:12 
QuestionRounding a calculation to the nearest 0 or 5 Pin
DiesenDesign14-Jan-12 15:48
DiesenDesign14-Jan-12 15:48 
AnswerRe: Rounding a calculation to the nearest 0 or 5 Pin
Aniruddha Loya14-Jan-12 20:53
Aniruddha Loya14-Jan-12 20:53 
GeneralRe: Rounding a calculation to the nearest 0 or 5 Pin
DiesenDesign15-Jan-12 14:07
DiesenDesign15-Jan-12 14:07 
GeneralRe: Rounding a calculation to the nearest 0 or 5 Pin
Aniruddha Loya15-Jan-12 19:27
Aniruddha Loya15-Jan-12 19:27 
I guess your entire script is not there again...

Anyways... Math.ceil will always take it to next higher number whereas Math.round round it to the nearest integer. So you can choose as per your requirement.

From what I think you are looking to do is - You require (CourseHours/40) rounded to nearest 0 or 5... i.e. the number you eventually looking to round off is the output of - CourseHours/40...
So for my solution to work - 'n' should be substituted by - CourseHours/40
i.e
Math.ceil(CourseHours/40/5) * 5
or use Math.round as per your requirement.

I hope this helps.
Imagination is the one weapon in the war against reality!!!
aniruddhaloya.blogspot.com

GeneralRe: Rounding a calculation to the nearest 0 or 5 Pin
DiesenDesign22-Jan-12 11:44
DiesenDesign22-Jan-12 11:44 
AnswerRe: Rounding a calculation to the nearest 0 or 5 Pin
Aniruddha Loya23-Jan-12 23:31
Aniruddha Loya23-Jan-12 23:31 
AnswerRe: Rounding a calculation to the nearest 0 or 5 Pin
Satheesh154615-Jan-12 21:09
Satheesh154615-Jan-12 21:09 
QuestionNeed to work with a database Pin
MacRaider414-Jan-12 1:55
MacRaider414-Jan-12 1:55 
AnswerRe: Need to work with a database Pin
MacRaider416-Jan-12 6:58
MacRaider416-Jan-12 6:58 
Questiondocument.formname.objectname notation question Pin
Aleksey Shurtygin13-Jan-12 7:37
Aleksey Shurtygin13-Jan-12 7:37 
AnswerRe: document.formname.objectname notation question Pin
R. Giskard Reventlov13-Jan-12 8:03
R. Giskard Reventlov13-Jan-12 8:03 
GeneralRe: document.formname.objectname notation question Pin
Aleksey Shurtygin13-Jan-12 8:18
Aleksey Shurtygin13-Jan-12 8:18 
QuestionJavaScript Pin
dannaros12-Jan-12 4:47
dannaros12-Jan-12 4:47 
AnswerRe: JavaScript Pin
R. Giskard Reventlov13-Jan-12 7:59
R. Giskard Reventlov13-Jan-12 7:59 
GeneralRe: JavaScript Pin
dannaros13-Jan-12 8:04
dannaros13-Jan-12 8:04 
GeneralRe: JavaScript Pin
R. Giskard Reventlov13-Jan-12 12:15
R. Giskard Reventlov13-Jan-12 12:15 
GeneralRe: JavaScript Pin
dannaros13-Jan-12 23:21
dannaros13-Jan-12 23:21 
QuestionHow can I download this video? Pin
turbosupramk39-Jan-12 8:29
turbosupramk39-Jan-12 8:29 
Questionwondering why about the site..jump..other site.. Pin
hack0042-Jan-12 2:18
hack0042-Jan-12 2:18 
AnswerRe: wondering why about the site..jump..other site.. Pin
DaveAuld2-Jan-12 2:36
professionalDaveAuld2-Jan-12 2:36 
AnswerRe: wondering why about the site..jump..other site.. Pin
thatraja2-Jan-12 2:49
professionalthatraja2-Jan-12 2:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.