74 auto int_part =
static_cast<int64_t
>(number);
75 double frac = number - int_part;
76 double rounding_factor = std::pow(10, placeholder);
77 auto rounded_part =
static_cast<int64_t
>(frac * rounding_factor);
79 if (
static_cast<double>(rounded_part) >= rounding_factor) {
81 rounded_part -=
static_cast<int64_t
>(rounding_factor);
84 toString(builder, int_part, 10,
true);
85 if (placeholder > 0) {
87 if (rounded_part < 0) {
88 rounded_part = -rounded_part;
90 toString(builder, rounded_part, 10,
true);
92 if (len < placeholder) {
93 builder.append(std::string(placeholder - len,
'0'));