summaryrefslogtreecommitdiff
path: root/core/variant_parser.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-01-10 11:51:05 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-01-10 11:51:05 -0300
commitcc34e0dee9e92468f9493d0001a296aa6bd08e6d (patch)
treef4b83ce7fdd04815b3563e04f7f5b6695b06d20e /core/variant_parser.cpp
parent6c8cf306978d694b51f3cdabea43a6774b1fc055 (diff)
Make sure variant parser actually writes floats when float property is requested, closes #3301
Diffstat (limited to 'core/variant_parser.cpp')
-rw-r--r--core/variant_parser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 446f9ae6d1..491eacb099 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -1801,7 +1801,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str
} break;
case Variant::REAL: {
- p_store_string_func(p_store_string_ud, rtoss(p_variant.operator real_t()) );
+ String s = rtoss(p_variant.operator real_t());
+ if (s.find(".")==-1 && s.find("e")==-1)
+ s+=".0";
+ p_store_string_func(p_store_string_ud, s );
} break;
case Variant::STRING: {