math.round
Arrotonda un numero all'intero più vicino.
Firma
math.round(x: number): number
Parametri
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
x | number | Obbligatorio | Il numero su cui lavorare. |
Restituisce
number Il numero risultante.
Esempio
const near: number = math.round(hp / 3);
