Python Forum
python decimal scale precision
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
python decimal scale precision
#1
Good morning, i'm starting a project in python, for a documents-of-transport, invoice, etc.
In this project i need to use the DECIMAL type, but i need to set the right scale precision (ex: for the VAT i need to have 1 digit, for the quantity in d.o.t. i need to have 2 digits).
In Postgresql i have the NUMERIC data type, that permits to set the scale precision, but i haven't find something similar in python.
The scale precision is fundamental (ex. here in italy the invoices must have 2 digit precision: if i multiply a price for 1.22 -the normal VAT in italy-, i need to keep the 2 digit in the result).

i see there is a context-environment precision, but no variable-intrinsic-precision
Reply


Messages In This Thread
python decimal scale precision - by massimo_m - Aug-21-2019, 03:02 PM
RE: python decimal scale precision - by massimo_m - Aug-22-2019, 08:27 AM
RE: python decimal scale precision - by perfringo - Aug-22-2019, 11:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Gmpy2 Newbie Working on Precision charlesrkiss 5 597 Jan-23-2024, 04:23 PM
Last Post: charlesrkiss
  Precision with Decimal Type charlesrkiss 9 810 Jan-18-2024, 06:30 PM
Last Post: charlesrkiss
  Python Struct Question, decimal 10, \n and \x0a. 3python 2 685 Aug-11-2023, 09:29 AM
Last Post: 3python
  How to properly scale text in postscript conversion to pdf? philipbergwerf 3 1,177 Nov-07-2022, 01:30 PM
Last Post: philipbergwerf
  Precision conversion garynewport 2 977 Oct-19-2022, 10:47 AM
Last Post: garynewport
  KeyError: 0 when trying to dedupe and match records at scale Catalytic 1 2,216 Apr-07-2022, 06:34 PM
Last Post: deanhystad
  How to use a variable in Python (2.x) to define decimal part? MDRI 4 2,368 May-07-2021, 12:39 AM
Last Post: MDRI
  Matplotlib scale julienhofmann 0 1,822 Apr-04-2021, 08:50 AM
Last Post: julienhofmann
Photo Filtering data and precision during calculations Scientifix 0 1,800 Mar-30-2021, 01:00 PM
Last Post: Scientifix
  High-Precision Board Voltage Reading from Python into PD Liam484 1 2,106 Mar-29-2021, 02:57 PM
Last Post: Marbelous

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020