CH × Mod2 × R ÷ 100) × STAB × Type1 × Type2 × Mod3
You would floor after each call, like BasePower, Att/def stat, etc... You would not floor within something like BasePower during
BasePower = HH × BP × IT × CHG × MS × WS × UA × FA
right? It would make no sense here because if you did Helping Hand, which is 1.5 and floored that, it would always be 1.0, resulting in no bonus ever.
Thus, when you look at this:
[Sp]Def = Stat × SM × Mod × SX
It mentions that: If there are two simultaneous boosts in Mod, first apply the ability boost, then the item boost, and finally the Sandstorm boost.
However, you would multiply everything out in for that Mod, returning the result, without flooring, then calculate the total stat (no flooring inside), and when you finally return the result for the def stat, you would floor right before it. Right?