Permalink
Browse files

replace remaining occurences of _php_math_number_format

  • Loading branch information...
1 parent 0081e4d commit c1bc92bf48f09af0d3d7c34bd592fabfb4a16ed2 @maxbeutel maxbeutel committed May 23, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 library.c
View
@@ -259,8 +259,7 @@ redis_cmd_format_static(char **ret, char *keyword, char *format, ...) {
case 'f':
case 'F': {
double d = va_arg(ap, double);
- dbl_str = _php_math_number_format(d, 8, '.', '\x00');
- dbl_len = strlen(dbl_str);
+ dbl_len = spprintf(&dbl_str, 0, "%.8f", d);
smart_str_append_long(&buf, dbl_len);
smart_str_appendl(&buf, _NL, sizeof(_NL) - 1);
smart_str_appendl(&buf, dbl_str, dbl_len);
@@ -328,8 +327,7 @@ redis_cmd_format(char **ret, char *format, ...) {
case 'F':
case 'f': {
double d = va_arg(ap, double);
- dbl_str = _php_math_number_format(d, 8, '.', '\x00');
- dbl_len = strlen(dbl_str);
+ dbl_len = spprintf(&dbl_str, 0, "%.8f", d);
smart_str_append_long(&buf, dbl_len);
smart_str_appendl(&buf, _NL, sizeof(_NL) - 1);
smart_str_appendl(&buf, dbl_str, dbl_len);

0 comments on commit c1bc92b

Please sign in to comment.