From 068f06568be288b8628a4e24118503e4d9b7af1b Mon Sep 17 00:00:00 2001 From: Eric Smith Date: Sat, 25 Apr 2009 21:40:15 +0000 Subject: Issue #5835, deprecate PyOS_ascii_formatd. If anyone wants to clean up the documentation, feel free. It's my first documentation foray, and it's not that great. Will port to py3k with a different strategy. --- Objects/floatobject.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Objects/floatobject.c') diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 4f041f4820..382b991bdf 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -342,7 +342,6 @@ static void format_float(char *buf, size_t buflen, PyFloatObject *v, int precision) { register char *cp; - char format[32]; int i; /* Subroutine for float_repr and float_print. @@ -352,8 +351,8 @@ format_float(char *buf, size_t buflen, PyFloatObject *v, int precision) in such cases, we append ".0" to the string. */ assert(PyFloat_Check(v)); - PyOS_snprintf(format, 32, "%%.%ig", precision); - PyOS_ascii_formatd(buf, buflen, format, v->ob_fval); + _PyOS_double_to_string(buf, buflen, v->ob_fval, 'g', precision, + 0, NULL); cp = buf; if (*cp == '-') cp++; -- cgit v1.2.1