MCPcopy Create free account
hub / github.com/apache/cloudberry / additional_numeric_locale_len

Function additional_numeric_locale_len

src/fe_utils/print.c:218–233  ·  view source on GitHub ↗

Compute additional length required for locale-aware numeric output */

Source from the content-addressed store, hash-verified

216
217/* Compute additional length required for locale-aware numeric output */
218static int
219additional_numeric_locale_len(const char *my_str)
220{
221 int int_len = integer_digits(my_str),
222 len = 0;
223
224 /* Account for added thousands_sep instances */
225 if (int_len > groupdigits)
226 len += ((int_len - 1) / groupdigits) * strlen(thousands_sep);
227
228 /* Account for possible additional length of decimal_point */
229 if (strchr(my_str, '.') != NULL)
230 len += strlen(decimal_point) - 1;
231
232 return len;
233}
234
235/*
236 * Format a numeric value per current LC_NUMERIC locale setting

Callers 1

format_numeric_localeFunction · 0.85

Calls 1

integer_digitsFunction · 0.85

Tested by

no test coverage detected