I need a specifc equation on some parts of my website, the question is: is better create a module, or put all the code in phtml files?

ps: sorry my bad english.