Module: kamailio Branch: master Commit: ff7913f511f95a891fe870cb1fe88f586573af79 URL: https://github.com/kamailio/kamailio/commit/ff7913f511f95a891fe870cb1fe88f58...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2022-09-30T09:17:36+02:00
core: snexpr - compile time options for formatting fload with full precission
---
Modified: src/core/utils/snexpr.h
---
Diff: https://github.com/kamailio/kamailio/commit/ff7913f511f95a891fe870cb1fe88f58... Patch: https://github.com/kamailio/kamailio/commit/ff7913f511f95a891fe870cb1fe88f58...
---
diff --git a/src/core/utils/snexpr.h b/src/core/utils/snexpr.h index d6b9adac86..df409f8381 100644 --- a/src/core/utils/snexpr.h +++ b/src/core/utils/snexpr.h @@ -395,7 +395,11 @@ static int snexpr_format_num(char **out, float value) return -1; } if(value - (long)value != 0) { +#ifdef SNEXPR_FLOAT_FULLPREC + ret = snprintf(*out, 24, "%g", value); +#else ret = snprintf(*out, 24, "%.4g", value); +#endif } else { ret = snprintf(*out, 24, "%lld", (long long)value); }