fix formatDateTimeInJodaSyntax

This commit is contained in:
liuneng 2024-05-30 14:54:07 +08:00
parent d816f38d77
commit 81096b91b5
3 changed files with 11 additions and 2 deletions

View File

@ -245,16 +245,17 @@ private:
}
/// Digits
size_t digits_written = 0;
while (w >= 100)
{
w /= 100;
writeNumber2(dest + pos, n / w);
pos += 2;
digits_written += 2;
n = n % w;
}
if (n)
if (digits_written != digits)
{
dest[pos] = '0' + n;
++pos;

View File

@ -0,0 +1,3 @@
150
110
300

View File

@ -0,0 +1,5 @@
select formatDateTimeInJodaSyntax(toDate32('2012-05-29'), 'D');
select formatDateTimeInJodaSyntax(toDate32('2012-04-19'), 'D');
select formatDateTimeInJodaSyntax(toDate32('2010-10-27 13:41:27.0'), 'D');