X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/374ca955a76ecab1204ca8bfa63ff9238d998416..f59164e3d128c7675a4d3934206346a3384e53a5:/icuSources/common/ustrfmt.c diff --git a/icuSources/common/ustrfmt.c b/icuSources/common/ustrfmt.c index 81b778c1..5e9fb924 100644 --- a/icuSources/common/ustrfmt.c +++ b/icuSources/common/ustrfmt.c @@ -1,42 +1,13 @@ /* ********************************************************************** -* Copyright (C) 2001-2004, International Business Machines +* Copyright (C) 2001-2006, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** */ #include "cstring.h" #include "ustrfmt.h" -#include -U_CAPI char* U_EXPORT2 -uprv_dtostr(double value, char *buffer, int maximumDigits,UBool fixedPoint) -{ - char *itrPtr = buffer + 1; /* skip '-' or a number before the decimal */ - char *startPtr; - - sprintf(buffer,"%f",value); - - /* Find the decimal point. - Some unusal machines use a comma when the system locale changes - */ - while (isalnum(*itrPtr)) { - itrPtr++; - } - *itrPtr = '.'; - - /* truncate trailing zeros, except the one after '.' */ - startPtr = itrPtr + 1; - itrPtr = uprv_strchr(startPtr, 0); - while(--itrPtr > startPtr){ - if(*itrPtr == '0'){ - *itrPtr = 0; - }else{ - break; - } - } - return buffer; -} /*** * Fills in a UChar* string with the radix-based representation of a