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 remove decimal if the value is 0 ?

By
Ivan Wellistya
on 10/15/15, 5:10 AM 321 views

Hallo,

I want to ask.. How to remove decimal if the value is zero. Example 123,456,789.00 <--- how to remove 00 ?

Thanks

0
Juan Muñoz
On 10/15/15, 10:30 AM

I think in python you can do something like:

if(num.find(".00")){      #maybe this find method don't works, so see below

int(num)

}


Or directly, if you don't want do the condition:   int(num)

Examples:

num=0.999 -> int(num) -> num=0

num=123.456 -> int (num) -> num=123

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: 10/15/15, 5:10 AM
Seen: 321 times
Last updated: 10/15/15, 10:30 AM