6
I was doing some tests on Mysql and then the need arose to have to round a number to the largest. It would be something like:
if($numero == 1.5){
$numero = 2;
}
Even though I could do it like this, I wanted to avoid doing it if
/ else
.
Isn’t there a function that does this in Mysql? For example, a function that if the entered value is 1.5 is rounded to the highest, to 2 in the case?
@Lucaslopes If you ROUND(1.5, 0); it will round to 2 friend. It would be 0 decimal places.
– viana