mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
std::to_string is not good fpr serialising doubles
-- it uses fixed 6dp, xlsx wants 15sf -- stringstream with precision set to 15 serialises correctly
This commit is contained in:
parent
e8fcd49c0d
commit
d12d2e450b
|
@ -22,6 +22,7 @@
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
#include <detail/header_footer/header_footer_code.hpp>
|
#include <detail/header_footer/header_footer_code.hpp>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
namespace xlnt {
|
namespace xlnt {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
@ -527,7 +528,10 @@ std::string encode_header_footer(const rich_text &t, header_footer::location whe
|
||||||
if (run.second.get().has_size())
|
if (run.second.get().has_size())
|
||||||
{
|
{
|
||||||
encoded.push_back('&');
|
encoded.push_back('&');
|
||||||
encoded.append(std::to_string(run.second.get().size()));
|
std::stringstream ss;
|
||||||
|
ss.precision(15);
|
||||||
|
ss << run.second.get().size();
|
||||||
|
encoded.append(ss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (run.second.get().has_color())
|
if (run.second.get().has_color())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user