Rounding to significant figures in Postgres
If you want to round numbers to a specified number of significant figures, you can do this with the logarithm functions. For example, rounding the following numbers to two digits would do the following: 10;10 15;15 105;100 109;100 997;990 105050;100000 123456;120000 193456;190000 Here is the SQL – note the “-1” needs to be off by …
Continue reading “Rounding to significant figures in Postgres”