I’m looking for a JavaScript function which will round to the next multiple:
function arrondiSuperieur($nombre, $arrondi) {
return ceil($nombre / $arrondi) * $arrondi;
}
echo arrondiSuperieur(6, 5); //display 10
echo arrondiSuperieur(16, 7); //display 21
Have you an idea?
Translated PHP to JS:
alertshows a dialog with the result. You can also usedocument.writeif the script is directly run on load within the<body>tags.