mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 17:24:23 -04:00
Don’t use single letter variable names
Better to call the variables what they are. Also re-orders the statement to avoid adding to a negative number.
This commit is contained in:
@@ -16,10 +16,10 @@ from app.notify_client.broadcast_message_api_client import (
|
|||||||
from app.notify_client.service_api_client import service_api_client
|
from app.notify_client.service_api_client import service_api_client
|
||||||
|
|
||||||
|
|
||||||
def round_to_significant_figures(x, n):
|
def round_to_significant_figures(value, number_of_significant_figures):
|
||||||
return int(round(
|
return int(round(
|
||||||
x,
|
value,
|
||||||
-int(floor(log10(abs(x)))) + (n - 1)
|
number_of_significant_figures - int(floor(log10(abs(value)))) - 1
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user