P
P
PageUp2021-07-25 16:41:45
PHP
PageUp, 2021-07-25 16:41:45

How to make 5 out of 56, how to make 7 out of 78, etc.?

rOund and ceil and other fractions round off. And I need to bring the number to a round ten and make a single digit out of it.

That is, as I understand it, it is necessary to somehow bring the number to an even tenfold. And then divide by 10.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2021-07-25
@PageUp

Divide by 10 and round down
floor(56 / 10); // 5

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question