File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -436,11 +436,11 @@ def __call__(self, num):
436
436
representing the power of 1000 of the original number. Some examples:
437
437
438
438
>>> format_eng(0) # for self.accuracy = 0
439
- '0'
439
+ ' 0'
440
440
441
441
>>> format_eng(1000000) # for self.accuracy = 1,
442
442
# self.use_eng_prefix = True
443
- '1.0M'
443
+ ' 1.0M'
444
444
445
445
>>> format_eng("-1e-6") # for self.accuracy = 2
446
446
# self.use_eng_prefix = False
@@ -481,10 +481,8 @@ def __call__(self, num):
481
481
mant = sign * dnum / (10 ** pow10 )
482
482
483
483
if self .accuracy is None : # pragma: no cover
484
- format_str = u"%g%s"
485
- elif self .accuracy == 0 :
486
- format_str = u"%i%s"
487
- elif self .accuracy > 0 :
484
+ format_str = u"% g%s"
485
+ else :
488
486
format_str = (u"%% .%if%%s" % self .accuracy )
489
487
490
488
formatted = format_str % (mant , prefix )
You can’t perform that action at this time.
0 commit comments