 # Is it possible to use exponents & square roots for calculations? Additional questions for calculations

For calculations in Senaite, is it possible to use exponents & square roots?

Also, is it possible to create conditional calculations? For example, if a certain value is 1, output 10. If 2, output 17.

Finally, can you set the significant digits in decimal places?

sure, you can use all python functions, if you take care that necessary modules are installed and configured correctly.
E.g. we use SciPy for some statistics.
You can create complex user-defined functions per code in your
`calculations.py` file.

For simple conditions you can use functional syntax kind of
value = this if condition else that

Significant digits are on my wishlist too, my workaround is about applying `Calculate Precision from Uncertainties`, which works quite well with results <1.
e.g. if you define a uncertainty of 1 %, the result is rounded to the digit, which represents 1 % of the original value, so you get 3 significant figures.
With 10 % you get 2 digits, etc.

1 Like

I am familiar with Python. Where can I read more about these 3 things I asked?

Thanks in advance!

we use SciPy for some statistics.
You can create complex user-defined functions per code in your
`calculations.py` file.

For simple conditions you can use functional syntax kind of
value = this if condition else that

Significant digits are on my wishlist too, my workaround is about applying `Calculate Precision from Uncertainties`, which works quite well with results <1.
e.g. if you define a uncertainty of 1 %, the result is rounded to the digit, which represents 1 % of the original value, so you get 3 significant figures.
With 10 % you get 2 digits, etc.

Is it ok if you share some examples of it here? I am still new to Senaite; your help will be very much appreciated. Thanks!

See my answer to

For significant figures I will show my example as a new topic.