Help

0

Format decimal number

Avatar
Vu Huynh

Hi all,

I'm using Odoo 10 with Purchase module. How can I customize the format of decimal number?

E.g: the Unit Price and Total, Sub Total... The current number format is 27,000.00, I want to change it to 27,000

Does anyone has experience with this?

Avatar
Discard
5 Answers
0
Avatar
Haresh Kansara
Best Answer

Hello Odooers,

I think if you are dealing with Monetary fields, then you dont need any code change, only need to set proper

"Decimal Places" in currency settings.

Steps to change Subtotal fields (Monetary) decimal accuracy from 2 digit to 3 digits:

1. Activate Multi Currency from General Settings (Settings > General Settings > Accounting ('Invoicing' If Community)), Now activate Multi-Currencies from Currencies section.

2. Now go to Accounting ('Invoicing' If Community) > Configuration > Accounting > Currencies.

3. In currency form change value 0.010000 to 0.001000 in Rounding Factor field and save record.

I hope this will helpful.

--
Regards
Haresh Kansara
Odoo Application Engineer
  


Avatar
Discard
0
Best Answer

Hi Vu,

The answer of Niyas is perfect once you will change the product price digits. for the subtotal and unit price go to the price list and Open the currency and change the rounding factor which will affect in unit and subtotal.


Thanks.

2 Comments
Avatar
Discard
Avatar
Vu Huynh
-

Thanks

Avatar
Vu Huynh
-

Hi Jainesh,

Thanks for your reply.

But there is another place where the decimal value still show is the sum of list view.

I set the rounding factor of currency to 0, the purchase order line show correctly. But in sum of list purchase order, it still contains the decimal value (.00).

How can I remove it?

0
Avatar
Niyas Raphy
Best Answer

Hi,

To adjust the decimal points , activate the developer mode and navigate to Settings -> Technical -> Database Structure -> Decimal Accuracy.

Adjust the number of decimal point from here.


Have a look at this link also : https://www.odoo.com/forum/help-1/question/sale-order-total-amount-to-three-decimal-places-116978

Thanks

1 Comment
Avatar
Discard
Avatar
Vu Huynh
-

Hi,

Yes, I can change the Product Price, but how can I change the format of "Total" or "Sub Total"? It still have 2 digits for decimal

0
Avatar
Vu Huynh
Best Answer

hi  Jainesh Shah,

I tried set the Product Price decimal digits to 0, but only affect to Unit Price, the Total and Subtotal still have decimal digits.


Avatar
Discard
-1
Avatar
Mostafa Razavi
Best Answer

If you want to remove decimal in product you can do by set zero in decimal accuracy from Settings -> Technical -> Database Structure -> Decimal Accuracy

if you want to remove zero in total and subtotal you have to set decimal places in your currency by the some hack in database table res_currency, you have to change column decimal_places to zero.

Avatar
Discard