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 2 decimals, even if the value 00

By
henro
on 9/22/15, 10:28 PM 513 views

i to all,

how to round 2 decimals, even if the value are 00

example : 12.00 

can i do this on python

regards 

We can achieve using python using help of "%.2f" format specifier. Can you explain more your requirement ? where you want to put 2 decimal ? i.e. inside any report or inside any web form etc...

Emipro Technologies Pvt. Ltd.
on 9/23/15, 1:09 AM
3

Parikshit

--Parikshit--
939
| 6 3 8
Ahmedabad, India
--Parikshit--

Working as an OpenERP/Odoo developer both experience in web and addons. you can contact me at:

E-mail : parikshitvaghasiya@gmail.com

Blog : parikshitvaghasiya.blogspot.in

Stackoverflow : http://stackoverflow.com/users/5089106/parikshit-vaghasiya

Parikshit
On 9/23/15, 1:11 AM

Python only displays what's needed, so it displated 10.0

If it's the matter of printing it as 10.00.

To do that.

>>> d = 10
>>> print "Value: %.2f" % float(d)
Value: 10.00
>>>

Hope this will help you.

thanks Parikshit :)

henro
on 9/29/15, 9:36 PM

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/22/15, 10:28 PM
Seen: 513 times
Last updated: 9/23/15, 1:11 AM