diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-09-17 13:32:18 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-09-17 13:32:18 +0000 |
commit | b5b5a8f0780c94d6973849925747efe92490a7da (patch) | |
tree | e56811095a9475ce567bc644e8de17bde8d48367 | |
parent | c5d12488d9324671cce63c4feed858f82530110e (diff) | |
download | perl-b5b5a8f0780c94d6973849925747efe92490a7da.tar.gz |
A better version of change #28847
p4raw-link: @28847 on //depot/perl: e24f8a798207476769992a3387804af506c43eab
p4raw-id: //depot/perl@28861
-rw-r--r-- | universal.c | 6 | ||||
-rw-r--r-- | util.c | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/universal.c b/universal.c index 7bbcbdbed9..52395cce69 100644 --- a/universal.c +++ b/universal.c @@ -688,7 +688,13 @@ XS(XS_version_qv) if ( SvNOK(ver) ) /* may get too much accuracy */ { char tbuf[64]; +#ifdef USE_LOCALE_NUMERIC + char *loc = setlocale(LC_NUMERIC, "C"); +#endif const STRLEN len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVgf, SvNVX(ver)); +#ifdef USE_LOCALE_NUMERIC + setlocale(LC_NUMERIC, loc); +#endif version = savepvn(tbuf, len); } else @@ -4304,9 +4304,13 @@ Perl_upg_version(pTHX_ SV *ver) { char tbuf[64]; STRLEN len; - SET_NUMERIC_STANDARD(); +#ifdef USE_LOCALE_NUMERIC + char *loc = setlocale(LC_NUMERIC, "C"); +#endif len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver)); - SET_NUMERIC_LOCAL(); +#ifdef USE_LOCALE_NUMERIC + setlocale(LC_NUMERIC, loc); +#endif while (tbuf[len-1] == '0' && len > 0) len--; version = savepvn(tbuf, len); } |