Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to round to the next multiple openerp

By
ATSE ARISTIDE
on 9/29/14, 7:49 AM 574 views

Hello

I want to round totalRemises to the lower multiple

Example: if totalRemises is 1245, I want to round to 1000

// total des remises
            var totalRemises = 0;
            totalRemises = (parseFloat(specialDiscount)/100) * parseFloat(totalDeDepart) ;

0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 9/29/14, 10:42 AM

Divide the totalRemises by 1000, then use either python's built in floor() or top() function to set it to an integer of 1 or 2. Once that is done, multiply by 1000 again.

Would that help?

0
ATSE ARISTIDE
On 9/30/14, 9:53 AM

thanks for your help

If my answer helped you and the problem is solved, please mark it as the correct answer. That way this issue will disappear from the active list, cleaning up a little bit.

Ludo - Neobis
on 9/30/14, 10:26 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/29/14, 7:49 AM
Seen: 574 times
Last updated: 3/16/15, 8:10 AM