There is a script editor in Designer where you can add scripts to different events for any selected object (see the help for more information how to use).
Designer supports two different scripting languages which are FormCalc and JavaScript.
For calculations FormCalc is often the better choice as its syntax is simple and easy to learn.