summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/drivers/firebird/PreparedStatement.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 69ce91f42da1..71a43454f315 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -18,6 +18,7 @@
*/
#include <sal/config.h>
+#include <cmath>
#include <string_view>
@@ -729,7 +730,8 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c
OUString sValue;
if( x >>= dbValue )
{
- sValue = OUString::number( dbValue );
+ // truncate and round to 'scale' number of decimal places
+ sValue = OUString::number( std::floor((dbValue * pow10Integer(scale)) + .5) / pow10Integer(scale) );
}
else
{