How can I round a calculated value server side?
How can I round a calculated value server side?

I am trying to round a calculated value that I am getting from a preEdit event. I need the value that is being submitted to the database to be rounded to 2 decimal places. I have tried to add the PHP round function before the setValue and it breaks the file. Do you have any suggestions for this? I don't want to use render on the client side such as .toFixed(2) because I need the value rounded in the database. Is there a way I can do this with getFormatter?
This question has an accepted answers - jump to answer
Answers
You say you want to submit the value to the database. So why would you use a getFormatter? Use a setFormatter please.
I figured it was getFormatter I just didn't know how to set it up. Thanks