diff --git a/libs/libc/stdio/lib_libvsprintf.c b/libs/libc/stdio/lib_libvsprintf.c index 3288f343c4..d69f4b473b 100644 --- a/libs/libc/stdio/lib_libvsprintf.c +++ b/libs/libc/stdio/lib_libvsprintf.c @@ -878,8 +878,32 @@ flt_oper: ndigs += 1; } - putc(ndigs, stream); - putc('0' + exp, stream); + /* Parse the ndigs if the value of it bigger than '9' */ + + while (1) + { + if (ndigs >= 'd') + { + putc(((ndigs - '0') / 100) + '0', stream); + ndigs = (ndigs - '0') % 100 + '0'; + } + else if (ndigs >= ':') + { + putc(((ndigs - '0') / 10) + '0', stream); + ndigs = (ndigs - '0') % 10 + '0'; + } + else if(ndigs >= '0') + { + putc(ndigs, stream); + break; + } + else + { + break; + } + } + + putc('0' + exp, stream); } goto tail;