diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-02-12 09:44:12 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-02-13 08:30:00 +0100 |
commit | 07f40bd25442f25c0af948ae1b0dac7fdff1688c (patch) | |
tree | 3fca13d92b02bc3712d98c3c43f9612ae4c56cf1 /libqpdf/QPDFObjectHandle.cc | |
parent | 8fbc8579f2481dc3eeb962e99522047291e16fbe (diff) | |
download | qpdf-07f40bd25442f25c0af948ae1b0dac7fdff1688c.tar.zst |
QUtil::double_to_string: trim trailing zeroes with option to disable
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 15907f6e..94875e13 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -2422,7 +2422,16 @@ QPDFObjectHandle::newReal(std::string const& value) QPDFObjectHandle QPDFObjectHandle::newReal(double value, int decimal_places) { - return QPDFObjectHandle(new QPDF_Real(value, decimal_places)); + return QPDFObjectHandle( + new QPDF_Real(value, decimal_places, true)); +} + +QPDFObjectHandle +QPDFObjectHandle::newReal(double value, int decimal_places, + bool trim_trailing_zeroes) +{ + return QPDFObjectHandle( + new QPDF_Real(value, decimal_places, trim_trailing_zeroes)); } QPDFObjectHandle |