Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-05-23 05:05:42 +0300
committerCampbell Barton <campbell@blender.org>2022-05-23 05:35:37 +0300
commit47b0ca85cd9596bc4948b15a77b45cbd7812554c (patch)
treeb28ce41e9fe925bfe65db5f7a1eee939872c8904 /release/scripts
parent568b692bcf8619ae057a0e604bf6e9e2ad89a15c (diff)
Fix float representation for Python API docs
float_as_string(1000000) resulted in 1e+06.0 which isn't valid notation.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/modules/rna_info.py3
1 files changed, 2 insertions, 1 deletions
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