I need to round down to the nearest quarter hour (or .25 in decimal) via Javascript and have not come across any appropriate code yet. Anyone have a solution?
SBA-CDeCinko
0
Light Poster
Recommended Answers
Jump to PostIf you want to always round down to the quarter
((int)(d/.25))*.25
If you want to round to the nearest quarter
Math.round(d/.25)*.25
All 4 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
SBA-CDeCinko
0
Light Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
SBA-CDeCinko
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.