move code into controller and result toFixed