mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
fix windows warnings
This commit is contained in:
parent
e222e1b268
commit
0c9bde91b7
|
@ -21,6 +21,7 @@
|
||||||
// @license: http://www.opensource.org/licenses/mit-license.php
|
// @license: http://www.opensource.org/licenses/mit-license.php
|
||||||
// @author: see AUTHORS file
|
// @author: see AUTHORS file
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#include <detail/number_formatter.hpp>
|
#include <detail/number_formatter.hpp>
|
||||||
|
@ -1235,7 +1236,7 @@ std::string number_formatter::fill_scientific_placeholders(const format_placehol
|
||||||
const format_placeholders &fractional_part, const format_placeholders &exponent_part,
|
const format_placeholders &fractional_part, const format_placeholders &exponent_part,
|
||||||
long double number)
|
long double number)
|
||||||
{
|
{
|
||||||
auto logarithm = 0;
|
std::size_t logarithm = 0;
|
||||||
|
|
||||||
if (number != 0)
|
if (number != 0)
|
||||||
{
|
{
|
||||||
|
@ -1420,8 +1421,8 @@ std::string number_formatter::format_number(const format_code &format, long doub
|
||||||
if (part.placeholders.type == format_placeholders::placeholders_type::fractional_part
|
if (part.placeholders.type == format_placeholders::placeholders_type::fractional_part
|
||||||
&& (format.is_datetime || format.is_timedelta))
|
&& (format.is_datetime || format.is_timedelta))
|
||||||
{
|
{
|
||||||
auto digits = std::min(6UL, part.placeholders.num_zeros + part.placeholders.num_optionals);
|
auto digits = std::min(static_cast<std::size_t>(6), part.placeholders.num_zeros + part.placeholders.num_optionals);
|
||||||
auto denominator = std::pow(10, digits);
|
auto denominator = static_cast<int>(std::pow(10.0, digits));
|
||||||
auto fractional_seconds = dt.microsecond / 1.0E6 * denominator;
|
auto fractional_seconds = dt.microsecond / 1.0E6 * denominator;
|
||||||
fractional_seconds = std::round(fractional_seconds) / denominator;
|
fractional_seconds = std::round(fractional_seconds) / denominator;
|
||||||
result.append(fill_placeholders(part.placeholders, fractional_seconds));
|
result.append(fill_placeholders(part.placeholders, fractional_seconds));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user