Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js arrotondare numeri

var a = Math.round(2.3);       // a is now 2  
var b = Math.round(2.7);       // b is now 3
var c = Math.round(2.5);       // c is now 3

var a = Math.ceil(2.3);        // a is now 3
var b = Math.ceil(2.7);        // b is now 3

Input  : Math.floor(5.78)
Output : 5

Input  : Math.floor(1.5)
Output : 1
Source by riptutorial.com #
 
PREVIOUS NEXT
Tagged: #js #arrotondare #numeri
ADD COMMENT
Topic
Name
8+5 =