Compute additional length required for locale-aware numeric output */
| 216 | |
| 217 | /* Compute additional length required for locale-aware numeric output */ |
| 218 | static int |
| 219 | additional_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 |
no test coverage detected