Also fix cases when thousands separator should be put before number. For
example before for grouping sequence "\003\003" number 123456 was formated as ",123,456", now "123,456".
This commit is contained in:
parent
ebacce5e99
commit
243e90d646
@ -221,7 +221,8 @@ __ultoa(u_long val, char *endp, int base, int octzero, char *xdigs,
|
||||
* If (*grp == CHAR_MAX) then no more grouping
|
||||
* should be performed.
|
||||
*/
|
||||
if (needgrp && ndig == *grp && *grp != CHAR_MAX) {
|
||||
if (needgrp && ndig == *grp && *grp != CHAR_MAX
|
||||
&& sval > 9) {
|
||||
*--cp = thousep;
|
||||
ndig = 0;
|
||||
/*
|
||||
@ -291,7 +292,8 @@ __ujtoa(uintmax_t val, char *endp, int base, int octzero, char *xdigs,
|
||||
* If (*grp == CHAR_MAX) then no more grouping
|
||||
* should be performed.
|
||||
*/
|
||||
if (needgrp && *grp != CHAR_MAX && ndig == *grp) {
|
||||
if (needgrp && *grp != CHAR_MAX && ndig == *grp
|
||||
&& sval > 9) {
|
||||
*--cp = thousep;
|
||||
ndig = 0;
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user