Browse code

core: snexpr - compile time options for formatting fload with full precission

Daniel-Constantin Mierla authored on 30/09/2022 07:17:36
Showing 1 changed files
... ...
@@ -395,7 +395,11 @@ static int snexpr_format_num(char **out, float value)
395 395
 		return -1;
396 396
 	}
397 397
 	if(value - (long)value != 0) {
398
+#ifdef SNEXPR_FLOAT_FULLPREC
399
+		ret = snprintf(*out, 24, "%g", value);
400
+#else
398 401
 		ret = snprintf(*out, 24, "%.4g", value);
402
+#endif
399 403
 	} else {
400 404
 		ret = snprintf(*out, 24, "%lld", (long long)value);
401 405
 	}