televi Posted September 7, 2016 Share Posted September 7, 2016 (edited) Hello Everyone, In excel, i have =ROUNDUP(cell,2) which rounds up the number differently than prestashop, example: if in the cell i have 0.6108838 will equal to 0.62... where as in prestashop it shows up as 0.61 how can i fix this issue? what do i have to do to roundup the same way that excel does it? I also came across this: Excel-like ROUNDUP function:public static function round_up($value, $places) { $mult = pow(10, abs($places)); return $places < 0 ? ceil($value / $mult) * $mult : ceil($value * $mult) / $mult;}echo round_up(12345.23, 1); // 12345.3echo round_up(12345.23, 0); // 12346 echo round_up(12345.23, -1); // 12350 echo round_up(12345.23, -2); // 12400 echo round_up(12345.23, -3); // 13000 echo round_up(12345.23, -4); // 20000 but how can i implemennt this in prestashop ? Thannk you so much Edited September 7, 2016 by televi (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 8, 2016 Share Posted September 8, 2016 Have you tried going to the Preferences > General tab in the Back Office and setting the "Round mode" to "Round up to the nearest value"? Link to comment Share on other sites More sharing options...
televi Posted September 9, 2016 Author Share Posted September 9, 2016 Yes but that rounds it up to 0.61 where as I want it to be rounded to 0.62 Link to comment Share on other sites More sharing options...
Apium Posted September 12, 2016 Share Posted September 12, 2016 In the Preferences > General tab in the Back Office, could you check the value in the "Number of decimals" field? This should be two, for the behaviour you described. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now