Skip to content

NumberFormatter::append broken #80

@lucas-clemente

Description

@lucas-clemente

I'm expecting the following to output "1.00", but it gives "10". Happens only with natural numbers. Looking at the code I think this is due to the conversion not outputting a separator but the padding code expecting one.

#include <iostream>
#include <Poco/NumberFormatter.h>

int main(int argc, const char * argv[]) {
  Poco::NumberFormatter f;
  string s;
  f.append(s, static_cast<double>(1), 2);
  std::cout << s << std::endl; // => 10
  return 0;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions