Did I find the right examples for you? yes no

All Samples(25)  |  Call(25)  |  Derive(0)  |  Import(0)
float.__format__(format_spec) -> string

Formats the float according to format_spec.

src/s/y/Sypy-HEAD/objspace/std/test/test_floatobject.py   Sypy(Download)
    def test_format(self):
        f = 1.1234e200
        assert f.__format__("G") == "1.1234E+200"
 
    def test_float_real(self):

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/test/test_types.py   main(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/test/test_types.py   main(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

src/t/r/TrustRouter-HEAD/client/packaging/Windows/Python32/Lib/test/test_types.py   TrustRouter(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

src/p/y/pytaint-HEAD/Python-2.7.5-pytaint/Lib/test/test_types.py   pytaint(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

src/m/a/main-HEAD/Languages/IronPython/Tests/test_strformat.py   main(Download)
        # and restore it back...
        _locale.setlocale(_locale.LC_ALL, 'C')
        AreEqual(100000.0.__format__('n'), '100000')
 
def test_float___format___errors():
    # verify the okChars are actually ok
    for char in okChars:
        2.0.__format__('10' + char)
 
    for char in allChars:

src/g/i/gitstack-HEAD/python/Lib/test/test_types.py   gitstack(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

src/e/m/empythoned-HEAD/cpython/Lib/test/test_types.py   empythoned(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

src/p/y/PyCPython-HEAD/Python-2.7.1/Lib/test/test_types.py   PyCPython(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

src/p/y/PyAutoC-HEAD/Python27/Lib/test/test_types.py   PyAutoC(Download)
            # platforms only the first few digits of dtoa
            # will be reliable
            result = f.__format__(fmt)
            self.assertEqual(len(result), 98)
            self.assertEqual(result[-7], '.')
            self.assertIn(result[:12], ('112340000000', '112339999999'))
        f = 1.1234e200
        for fmt in 'f', 'F':
            result = f.__format__(fmt)

  1 | 2  Next