Metoda Math.ceil
Metoda Math.ceil kryen rrumbullakimin
e një numri thyesor drejt numrit të plotë gjithmonë lart.
Sintaksa
Math.ceil(numri);
Shembull
Le të rrumbullakojmë numrin 3.00001 lart:
console.log(Math.ceil(3.00001));
Rezultati i ekzekutimit të kodit:
4
Shihni gjithashtu
-
metoda
Math.floor,
e cila kryen rrumbullakimin e numrit poshtë -
metoda
Math.round,
e cila gjithashtu kryen rrumbullakimin e numrit drejt numrit të plotë -
metodat
toFixeddhetoPrecision,
të cilat gjithashtu kryejnë rrumbullakimin e numrit