File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -226,14 +226,18 @@ static void strstrip(char *str) {
226226/* Helper function to convert mpf_t to mpz_t with round-toward-zero (truncate decimal) */
227227static void mpz_set_f_round_zero (mpz_t rop , const mpf_t op ) {
228228 char * str ;
229+ const char * radix_char ;
229230 char * dot ;
230231 char * exp ;
231232
232233 /* Convert to decimal string with enough precision */
233234 gmp_asprintf (& str , "%.100Ff" , op );
234235
235- /* Find decimal point and truncate */
236- dot = strchr (str , '.' );
236+ /* Get the locale's decimal separator */
237+ radix_char = nl_langinfo (RADIXCHAR );
238+
239+ /* Find decimal point (using locale's separator) and truncate */
240+ dot = strchr (str , radix_char [0 ]);
237241 if (dot ) {
238242 * dot = '\0' ;
239243 }
You can’t perform that action at this time.
0 commit comments