multiple of specific Number condition operator
-
12-05-2021 - |
سؤال
in magneto 2 we have condition operators such as
$operators = [
'>=' => __('equals or greater than'),
'<=' => __('equals or less than'),
'>' => __('greater than'),
'<' => __('less than'),
];
is there any operator for "multiple of specific number"
e.g:
multiple of 2 is 4,6,8,10
multiple of 3 is 6,9,12,15
kindly advise. Thanks
لا يوجد حل صحيح
نصائح أخرى
Could you just use PHP's fmod function?
I.e. "Is X a multiple of Y?"
- Is 20 a multiple of 4?
$multiple = fmod(20, 4)==0; if($multiple){...}
[1]: https://www.php.net/manual/en/function.fmod.php
لا تنتمي إلى magento.stackexchange