Browse files

Get %g format closer to correct.

  • Loading branch information...
1 parent 4b9c017 commit 7559ad4e8659b7fd9e45d39b363a922f962c6495 @colomon colomon committed Jul 5, 2012
Showing with 1 addition and 6 deletions.
  1. +1 −6 lib/Printf.cs
View
7 lib/Printf.cs
@@ -276,12 +276,7 @@ private struct PrintfFormat {
number = f.ToString("e" + format.precision);
break;
case PrintfDirective.FloatEF:
- log = Math.Log(Math.Abs(f), 10);
- if (log < -5 || log > 5) {
- number = f.ToString("e" + format.precision);
- } else {
- number = f.ToString("F" + format.precision);
- }
+ number = f.ToString("g" + format.precision);
break;
}

0 comments on commit 7559ad4

Please sign in to comment.