Commit 01a1a41e authored by Jerome Touvier's avatar Jerome Touvier
Browse files

Merge branch 'update' into 'master'

remove thousands separator for csv

See merge request !18
parents 31e6cbd5 6bed9979
...@@ -134,12 +134,14 @@ def format_results(params, data): ...@@ -134,12 +134,14 @@ def format_results(params, data):
if params["request"] == "country": if params["request"] == "country":
if "all" in params["country"]: if "all" in params["country"]:
data = [["all", data[0][0], data[0][1]]] data = [["all", data[0][0], data[0][1]]]
for row in data: if params["format"] != "csv":
row[:] = [row[0], "{:_}".format(row[1]), "{:_}".format(row[2])] for row in data:
row[:] = [row[0], "{:_}".format(row[1]), "{:_}".format(row[2])]
elif params["request"] == "send": elif params["request"] == "send":
result = data[0][0] if params["format"] != "csv":
data = [["{:_}".format(result) + f" bytes ({human_readable_size(result)})"]] result = data[0][0]
data = [["{:_}".format(result) + f" bytes ({human_readable_size(result)})"]]
data = [[str(val) for val in row] for row in data] data = [[str(val) for val in row] for row in data]
return data return data
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment