75 auto int_part =
static_cast<int64_t
>(number);
76 double frac = number - int_part;
77 double rounding_factor = std::pow(10, placeholder);
78 auto rounded_part =
static_cast<int64_t
>(frac * rounding_factor);
80 if (
static_cast<double>(rounded_part) >= rounding_factor) {
82 rounded_part -=
static_cast<int64_t
>(rounding_factor);
85 toString(builder, int_part, 10,
true);
86 if (placeholder > 0) {
88 if (rounded_part < 0) {
89 rounded_part = -rounded_part;
91 toString(builder, rounded_part, 10,
true);
93 if (len < placeholder) {
94 builder.append(std::string(placeholder - len,
'0'));