mirror of
https://github.com/pantor/inja.git
synced 2026-11-22 07:14:23 +00:00
fix msvc conversion warning
This commit is contained in:
1 parent
6b7b9f1604
commit
c2ad85db6d
2 files changed
+2
-2
No files matched your search
@@ -375,7 +375,7 @@ class Renderer : public NodeVisitor {
|
|||||||
} break;
|
} break;
|
||||||
case Op::Round: {
|
case Op::Round: {
|
||||||
const auto args = get_arguments<2>(node);
|
const auto args = get_arguments<2>(node);
|
||||||
const int precision = args[1]->get<const json::number_integer_t>();
|
const auto precision = args[1]->get<const json::number_integer_t>();
|
||||||
const double result = std::round(args[0]->get<const json::number_float_t>() * std::pow(10.0, precision)) / std::pow(10.0, precision);
|
const double result = std::round(args[0]->get<const json::number_float_t>() * std::pow(10.0, precision)) / std::pow(10.0, precision);
|
||||||
if (precision == 0) {
|
if (precision == 0) {
|
||||||
make_result(int(result));
|
make_result(int(result));
|
||||||
|
|||||||
@@ -2444,7 +2444,7 @@ class Renderer : public NodeVisitor {
|
|||||||
} break;
|
} break;
|
||||||
case Op::Round: {
|
case Op::Round: {
|
||||||
const auto args = get_arguments<2>(node);
|
const auto args = get_arguments<2>(node);
|
||||||
const int precision = args[1]->get<const json::number_integer_t>();
|
const auto precision = args[1]->get<const json::number_integer_t>();
|
||||||
const double result = std::round(args[0]->get<const json::number_float_t>() * std::pow(10.0, precision)) / std::pow(10.0, precision);
|
const double result = std::round(args[0]->get<const json::number_float_t>() * std::pow(10.0, precision)) / std::pow(10.0, precision);
|
||||||
if (precision == 0) {
|
if (precision == 0) {
|
||||||
make_result(int(result));
|
make_result(int(result));
|
||||||
|
|||||||
Reference in new issue
Block a user