I am trying to create a website with a database with PHP and data stored in a PostgreSQL database (PDO access), and I will need to store and process decimal numbers with high precision (in some cases more than 20 digits after the decimal).
I plan to use the NUMERIC or DECIMAL data types in my database to store this data to maintain the required high levels of accuracy.
What is the best way to use PHP to (1) access these values ββand (2) do basic arithmetic on such high-precision numbers?
I do not want to just use float, as this data type may be inaccurate.
Thanks!
thebrainkid
source share