use of MOD

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
rocketman
Posts: 1239
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

use of MOD

Post by rocketman »

Just being lazy and not wanting to set up a test BO

I'm trying to do something special when a list of items produces any result which is a multiple of 3 (3,6,9,12 etc), so lets say the number of items returned is 4, would MOD(4,3) give me 1 or 0.333 (it doesn't really matter as long as it's not 0. My formula would then be

IF MOD(Returned results,3) = 0 then do something
1/3 - fail
2/3 - fail
3/3 - pass
4/3 - fail
5/3 - fail
6/3 - pass

and so on
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: use of MOD

Post by customaware »

If your question is "Should this work?"

I would do precisely the same....in the absence of testing it. ;-)
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
rocketman
Posts: 1239
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Re: use of MOD

Post by rocketman »

Perfect 👍
Rocketman

V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
Post Reply