def test_float_str_formatting(self):
        self.assertEqual('%.13g' % 12345678.00005, '12345678.00005')
        self.assertEqual('%.12g' % 12345678.00005,
                         jython and '12345678' or '12345678.0001')
        self.assertEqual('%.11g' % 12345678.00005, '12345678')
        # XXX: The exponential formatter isn't totally correct, e.g. our
        # output here is really .13g
        self.assertEqual('%.12g' % math.pi**-100, '1.92758141606e-50')
        self.assertEqual('%.5g' % 123.005, '123')
        self.assertEqual('%#.5g' % 123.005, '123.00')
        self.assertEqual('%#g' % 0.001, '0.00100000')
        self.assertEqual('%#.5g' % 0.001, '0.0010000')
        self.assertEqual('%#.1g' % 0.0001, '0.0001')
        self.assertEqual('%#.4g' % 100, '100.0')
        self.assertEqual('%#.4g' % 100.25, '100.2')
        self.assertEqual('%g' % 0.00001, '1e-05')
        self.assertEqual('%#g' % 0.00001, '1.00000e-05')
        self.assertEqual('%e' % -400.0, '-4.000000e+02')
        self.assertEqual('%.2g' % 99, '99')
        self.assertEqual('%.2g' % 100, '1e+02')
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/test_float_jy.py/FloatTestCase.test_float_str_formatting/original