From 1d7f42ba0164e08ae0c8138131dd79b9b9b81766 Mon Sep 17 00:00:00 2001 From: bakpakin Date: Mon, 24 Apr 2017 21:08:53 -0400 Subject: [PATCH] Visual distinction between integers and reals. Add F suffix to real numbers when printed. --- core/value.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/value.c b/core/value.c index 177595c7..9667a274 100644 --- a/core/value.c +++ b/core/value.c @@ -33,13 +33,13 @@ int gst_truthy(GstValue v) { static const uint8_t *real_to_string(Gst *vm, GstReal x) { uint8_t buf[GST_BUFSIZE]; - int count = snprintf((char *) buf, GST_BUFSIZE, "%.21g", x); + int count = snprintf((char *) buf, GST_BUFSIZE, "%.21gF", x); return gst_string_b(vm, buf, (uint32_t) count); } static const uint8_t *integer_to_string(Gst *vm, GstInteger x) { uint8_t buf[GST_BUFSIZE]; - int count = snprintf((char *) buf, GST_BUFSIZE, "%ld", x); + int count = snprintf((char *) buf, GST_BUFSIZE, "%lld", x); return gst_string_b(vm, buf, (uint32_t) count); }