A
A
Alexander2019-02-20 13:26:56
PHP
Alexander, 2019-02-20 13:26:56

Adapting excel OKRWNOW to FLOOR php?

Can you please tell me how to implement the Excel formula OKRVNIZ (with rounding down to the nearest integer multiple of a certain factor) in php? The crux of the matter is that in the OKVDOWN the specified multiplier will be a multiple of the rounding result, but how to do this in php?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2019-02-20
@xapbyta

function floorLikeInExcel($number, $significance) {
  return $number - fmod($number, $significance);
}
https://ideone.com/1FsnOD
But the third example is not the same as in Excel, in which case it gives #NUM!
an additional check.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question