office-gobmx/sal/rtl
Eike Rathke 1ea85e8f2d Resolves: tdf#160985 Max integer representation for rtl_math_StringFormat_G
Same as for rtl_math_StringFormat_Automatic we want to preserve
the highest accuracy of integer values also with
rtl_math_StringFormat_G if nDecPlaces is large enough, instead of
possibly rounding into 15 digits. This occurred with
FastSaxSerializer::write(double) but rtl::OString::number(double)
and rtl::OUString::number(double) and rtl_math_doubleToString()
and rtl::str::valueOfFP() and rtl_str_valueOfDouble() and all
places calling with rtl_math_StringFormat_G are similar affected.

Question might remain why those places use
rtl_math_StringFormat_G with fixed nDecimalPlaces calculated from
RTL_STR_MAX_VALUEOFDOUBLE - SAL_N_ELEMENTS("-x.E-xxx") + 1
instead of rtl_math_StringFormat_Automatic with
rtl_math_DecimalPlaces_Max.

Change-Id: Ib388b119faed441c9020dca803649a4089da5b07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167647
Tested-by: Jenkins
Reviewed-by: Eike Rathke <erack@redhat.com>
2024-05-15 18:02:19 +02:00
..
alloc_arena.cxx
alloc_arena.hxx
alloc_cache.cxx
alloc_cache.hxx
alloc_fini.cxx
alloc_global.cxx
alloc_impl.hxx
bootstrap.cxx
byteseq.cxx
cipher.cxx
cmdargs.cxx
crc.cxx
digest.cxx
hash.cxx
hash.hxx
locale.cxx
math.cxx
random.cxx
rtl_process.cxx
strbuf.cxx
strimp.cxx
strimp.hxx
string.cxx
strtmpl.hxx
unload.cxx
uri.cxx
ustrbuf.cxx
ustring.cxx
uuid.cxx