From 47b0ca85cd9596bc4948b15a77b45cbd7812554c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 23 May 2022 12:05:42 +1000 Subject: [PATCH] Fix float representation for Python API docs float_as_string(1000000) resulted in 1e+06.0 which isn't valid notation. --- release/scripts/modules/rna_info.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py index 687f3c95d0b..76b59e4e816 100644 --- a/release/scripts/modules/rna_info.py +++ b/release/scripts/modules/rna_info.py @@ -61,7 +61,8 @@ def range_str(val): def float_as_string(f): val_str = "%g" % f - if '.' not in val_str and '-' not in val_str: # value could be 1e-05 + # Ensure a `.0` suffix for whole numbers, excluding scientific notation such as `1e-05` or `1e+5`. + if '.' not in val_str and 'e' not in val_str: val_str += '.0' return val_str