﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31487	Add support for precision argument to Round	Baptiste Mispelon	Nick Pope	"Django's `Round` function currently only supports rounding to the nearest integer. If you need to round to a more specific precision you need to roll out your own solution.

But as far as I can tell, all backends natively supported by Django support a second argument to `Round`:

* Postgres: https://www.postgresql.org/docs/12/functions-math.html#FUNCTIONS-MATH-FUNC-TABLE
* Sqlite: https://sqlite.org/lang_corefunc.html#round
* MySQL: https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_round
* Oracle: https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions135.htm

In my project (postgres only) my work around was to declare my own custom function:
{{{#!python
class Round(Func):
    function = 'ROUND'
    arity = 2
}}}

But having this built-in would be quite useful.
"	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	database function, round, precision, decimal places	pope1ni	Ready for checkin	1	0	0	0	0	0
