Naddiseo/dart-sprintf

Rounding error with %.xf

Closed this issue · 4 comments

Dart Output:
print(sprintf("%.2f", [5.466])); //5.46
print(sprintf("%.0f", [5.466])); //5. (<-- notice the dot!)

PHP Output:
echo sprintf("%.2f", 5.466); //5.47
echo sprintf("%.0f", 5.466); //5

Sorry for the wait, the email got lost. It's fixed now.

Thanks for the fix. As i can see you did fix the second variation of the bug. Did you fix the first case aswell?

I overlooked the first one as this is two separate issues. Reopening.

  • Rounding fixed in v.1.0.9