diff options
author | kobewi <kobewi4e@gmail.com> | 2024-03-26 17:04:14 +0100 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2024-10-23 15:00:21 +0200 |
commit | 5c0f2414cd6d988a4eab93fc21bc3b80388907e8 (patch) | |
tree | 05d11ea1b6d97b2cb8e2e203dba1ffb89dc70eb5 /core/extension/extension_api_dump.cpp | |
parent | 533c616cb86ff7bb940d58ffbbcc1a3eca0aa33d (diff) | |
download | redot-engine-5c0f2414cd6d988a4eab93fc21bc3b80388907e8.tar.gz |
Always add decimal when printing float
Diffstat (limited to 'core/extension/extension_api_dump.cpp')
-rw-r--r-- | core/extension/extension_api_dump.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index c5f7502c12..70785517a8 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -1371,6 +1371,9 @@ static bool compare_dict_array(const Dictionary &p_old_api, const Dictionary &p_ Dictionary elem = var; ERR_FAIL_COND_V_MSG(!elem.has(p_name_field), false, vformat("Validate extension JSON: Element of base_array '%s' is missing field '%s'. This is a bug.", base_array, p_name_field)); String name = elem[p_name_field]; + if (name.is_valid_float()) { + name = name.trim_suffix(".0"); // Make "integers" stringified as integers. + } if (p_compare_operators && elem.has("right_type")) { name += " " + String(elem["right_type"]); } @@ -1386,6 +1389,9 @@ static bool compare_dict_array(const Dictionary &p_old_api, const Dictionary &p_ continue; } String name = old_elem[p_name_field]; + if (name.is_valid_float()) { + name = name.trim_suffix(".0"); // Make "integers" stringified as integers. + } if (p_compare_operators && old_elem.has("right_type")) { name += " " + String(old_elem["right_type"]); } |