Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Discuss
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Float field Round up

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
odoo
6 Replies
25755 Tampilan
Avatar
RDS EPOS SOLUTIONS

Hi I have a float filed and if the value is 2.17 I want to round up to 3. So always round up 1?

I cant comment but below will not work becasue I only want to round up. Below will round up and down. I belive I need to use math.ceil 
but cant find any examples


from odoo.tools import float_round
round(field_name
0
Avatar
Buang
Manish Bohra

But it’s working for me like when value is 3.45 than it’s show 3 and if value js 3.51 than it will be show 4

JAVIER LIROLA

Hello. Did you solved? how you did it? i want to print values rounded up (ceiling) but I don´t know how to do it. In my case is just for PDF purpouses. Thanks

Avatar
Manish Bohra
Jawaban Terbai

Hello Jay Roy,

You can try below code i think it's help you.

from odoo.tools import float_round
round(field_name)
5
Avatar
Buang
Avatar
Pankaj Goyani
Jawaban Terbai

Hi Jay Roy,

You just need to do simple things which is giving odoo default.
This is a better way of doing it than hard coding as I can change the decimals to any figure from Odoo GUI under

 Technical >> Database Structure >> Decimal Accuracy >>
Change Digits 0 instead of 2 or 3.


Ex. Before Quantity display: 1.00 or 1.000

       After Quantity display: 1

Thanks.

3
Avatar
Buang
Avatar
Jithin PP
Jawaban Terbai

You can do like this in qweb

<p><t t-esc="round(6.2/9,2)"/></p>

3
Avatar
Buang
Avatar
Rakesh Vadeghar
Jawaban Terbai

Hey try this 

x = 2.1

y = float(int(round(x)))

print x,y

if x > y:

        x = y+1

        print x,y

elif x == y:

        pass

0
Avatar
Buang
Avatar
RDS EPOS SOLUTIONS
Penulis Jawaban Terbai

 I always want to want to round up. So 3.45 will become 4.

3.1 will be 4.

7.1 will be 8

Always up to the next never down. I read somewhere I need to be using math.ceil. reading up on that now
I also seen below trying to figure out how to use it though. I tried

from openerp.tools.float_utils  import float_round 

rolls_required = fields.float_round("Rolls Required", precision_digits=1, rounding_method='UP')

But I get TypeError: unsupported operand type(s) for /: 'str' and 'float'


// function for rounding numbers
from openerp.tools.float_utils import float_round // importing
// value - float number
// precision_digits - number of fractional digits to round to
// precision_rounding - decimal number representing the minimum non-zero value at the desired precision
// rounding_method - can be 'HALF-UP' or 'UP'
value1 = float_round(10.005, precision_digits=2, precision_rounding=None, rounding_method='HALF-UP')
value2 = float_round(10.005, precision_digits=None, precision_rounding=2, rounding_method='HALF-UP')
value3 = float_round(10.005, precision_digits=2, precision_rounding=None, rounding_method='UP')
value4 = float_round(10.005, precision_digits=None, precision_rounding=2, rounding_method='UP')
0
Avatar
Buang
Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
ENTREPRISE V18-Automatic draft Delivery Notes on Sales Orders causing sequence gaps and date inconsistencies
odoo
Avatar
0
Des 25
3
Automation to Validate Delivery and Invoice Addresses
odoo
Avatar
0
Des 25
66
Automation to Validate Delivery and Invoice Addresses
odoo
Avatar
0
Des 25
23
error while rendering the template website_sale.product_title after upgrading to Odoo 19
odoo
Avatar
0
Des 25
8
We are using Odoo POS (v19) for a wholesale / cash & carry business.
odoo
Avatar
0
Des 25
118
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now