[Libreoffice-commits] core.git: dbaccess/source
Tamas Bunth
tamas.bunth at collabora.co.uk
Thu Jun 14 11:15:29 UTC 2018
dbaccess/source/filter/hsqldb/rowinputbinary.cxx | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 1f91ebb586356aa77ecced15cd5e049f1ebca70c
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date: Mon Jun 11 07:47:15 2018 +0200
tdf#118043 dbahsql: Fix putDot funciton
Change-Id: Ia49b7e852446b05a4e20a7ff0c32d8acc6da52b2
Reviewed-on: https://gerrit.libreoffice.org/55594
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
diff --git a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
index d47901d2d7a4..d40d5332851e 100644
--- a/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
+++ b/dbaccess/source/filter/hsqldb/rowinputbinary.cxx
@@ -114,13 +114,12 @@ OUString lcl_makeStringFromBigint(const std::vector<sal_uInt8> bytes)
OUString lcl_putDot(const OUString& sNum, sal_Int32 nScale)
{
+ // e.g. sNum = "0", nScale = 2 -> "0.00"
OUStringBuffer sBuf{ sNum };
- if (nScale >= sNum.getLength())
- {
- sal_Int32 nNullsToAppend = nScale - sNum.getLength();
- for (sal_Int32 i = 0; i < nNullsToAppend; ++i)
- sBuf.insert(0, "0");
- }
+ sal_Int32 nNullsToAppend = nScale - sNum.getLength() + 1;
+ for (sal_Int32 i = 0; i < nNullsToAppend; ++i)
+ sBuf.insert(0, "0");
+
if (nScale > 0)
sBuf.insert(sBuf.getLength() - 1 - nScale, ".");
return sBuf.makeStringAndClear();
More information about the Libreoffice-commits
mailing list