mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-27 09:29:22 -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
|
||||
|
||||
|
||||
def round_to_significant_figures(x, n):
|
||||
def round_to_significant_figures(value, number_of_significant_figures):
|
||||
return int(round(
|
||||
x,
|
||||
-int(floor(log10(abs(x)))) + (n - 1)
|
||||
value,
|
||||
number_of_significant_figures - int(floor(log10(abs(value)))) - 1
|
||||
))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user