From: Ilia Alshanetsky Date: Mon, 25 Dec 2006 16:49:05 +0000 (+0000) Subject: MFB: Use %F (ignores locale) for internal representation of floats X-Git-Tag: RELEASE_1_0_0RC1~515 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=428f53e5fb0dd9eaf3482b812702830302a8ceb2;p=php MFB: Use %F (ignores locale) for internal representation of floats --- diff --git a/ext/exif/exif.c b/ext/exif/exif.c index a981be2613..c2a107e4a5 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3893,7 +3893,7 @@ PHP_FUNCTION(exif_read_data) exif_iif_add_int(&ImageInfo, SECTION_COMPUTED, "ByteOrderMotorola", ImageInfo.motorola_intel TSRMLS_CC); } if (ImageInfo.FocalLength) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1fmm", ImageInfo.FocalLength); + exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocalLength" TSRMLS_CC, "%4.1Fmm", ImageInfo.FocalLength); if(ImageInfo.CCDWidth) { exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "35mmFocalLength" TSRMLS_CC, "%dmm", (int)(ImageInfo.FocalLength/ImageInfo.CCDWidth*35+0.5)); } @@ -3903,19 +3903,19 @@ PHP_FUNCTION(exif_read_data) } if(ImageInfo.ExposureTime>0) { if(ImageInfo.ExposureTime <= 0.5) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); + exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s (1/%d)", ImageInfo.ExposureTime, (int)(0.5 + 1/ImageInfo.ExposureTime)); } else { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3f s", ImageInfo.ExposureTime); + exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ExposureTime" TSRMLS_CC, "%0.3F s", ImageInfo.ExposureTime); } } if(ImageInfo.ApertureFNumber) { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1f", ImageInfo.ApertureFNumber); + exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "ApertureFNumber" TSRMLS_CC, "f/%.1F", ImageInfo.ApertureFNumber); } if(ImageInfo.Distance) { if(ImageInfo.Distance<0) { exif_iif_add_str(&ImageInfo, SECTION_COMPUTED, "FocusDistance", "Infinite" TSRMLS_CC); } else { - exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2fm", ImageInfo.Distance); + exif_iif_add_fmt(&ImageInfo, SECTION_COMPUTED, "FocusDistance" TSRMLS_CC, "%0.2Fm", ImageInfo.Distance); } } if (ImageInfo.UserComment) { diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec index 72a2c55e5e..78bc3d591c 100644 --- a/ext/informix/ifx.ec +++ b/ext/informix/ifx.ec @@ -449,7 +449,7 @@ PHP_MINFO_FUNCTION(ifx) php_info_print_table_row(2, "Active Persistent links", buf); sprintf(buf, "%ld", IFXG(num_links)); php_info_print_table_row(2, "Active links", buf); - sprintf(buf, "%02.2f", (double)(IFX_VERSION/100.0)); + sprintf(buf, "%02.2F", (double)(IFX_VERSION/100.0)); php_info_print_table_row(2, "ESQL/C Version", buf); php_info_print_table_end(); diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 2a510228f4..eccc11f001 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -288,7 +288,7 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, php_stream_context_get_option(context, "http", "protocol_version", &tmpzval) == SUCCESS) { SEPARATE_ZVAL(tmpzval); convert_to_double_ex(tmpzval); - protocol_version_len = spprintf(&protocol_version, 0, "%.1f", Z_DVAL_PP(tmpzval)); + protocol_version_len = spprintf(&protocol_version, 0, "%.1F", Z_DVAL_PP(tmpzval)); } if (!scratch) { diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c index 6f58000f4b..9738eb3cc3 100644 --- a/ext/standard/microtime.c +++ b/ext/standard/microtime.c @@ -84,7 +84,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) } else { char ret[100]; - snprintf(ret, 100, "%.8f %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec); + snprintf(ret, 100, "%.8F %ld", tp.tv_usec / MICRO_IN_SEC, tp.tv_sec); RETURN_ASCII_STRING(ret, ZSTR_DUPLICATE); } }