You are here: irt.org | FAQ | JavaScript | Number | Q201 [ previous next ]
Rounds a number down:
<script language="JavaScript"><!-- alert(Math.floor(0.9)); // returns 0 alert(Math.floor(1.9)); // returns 1 alert(Math.floor(1)); // returns 1 alert(Math.floor(-1.9); // returns -2 alert(Math.floor(-0.01); // returns -1 //--></script>