How to use the ufonormalizer.xmlConvertFloat function in ufonormalizer

To help you get started, we’ve selected a few ufonormalizer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat(self):
        self.assertEqual(xmlConvertFloat(1.0), '1')
        self.assertEqual(xmlConvertFloat(1.01), '1.01')
        self.assertEqual(xmlConvertFloat(1.0000000001), '1.0000000001')
        self.assertEqual(xmlConvertFloat(1.00000000001), '1')
        self.assertEqual(xmlConvertFloat(1.00000000009), '1.0000000001')
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat(self):
        self.assertEqual(xmlConvertFloat(1.0), '1')
        self.assertEqual(xmlConvertFloat(1.01), '1.01')
        self.assertEqual(xmlConvertFloat(1.0000000001), '1.0000000001')
        self.assertEqual(xmlConvertFloat(1.00000000001), '1')
        self.assertEqual(xmlConvertFloat(1.00000000009), '1.0000000001')
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat_no_rounding(self):
        import ufonormalizer
        oldFloatFormat = ufonormalizer.FLOAT_FORMAT
        ufonormalizer.FLOAT_FORMAT = None
        self.assertEqual(xmlConvertFloat(1.0000000000000002), '1.0000000000000002')
        self.assertEqual(xmlConvertFloat(1.00000000000000001), '1')
        self.assertEqual(xmlConvertFloat(1.00000000000000019), '1.0000000000000002')
        self.assertEqual(xmlConvertFloat(1e-16), '0.0000000000000001')
        self.assertEqual(xmlConvertFloat(1e-17), '0')
        ufonormalizer.FLOAT_FORMAT = oldFloatFormat
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat_no_rounding(self):
        import ufonormalizer
        oldFloatFormat = ufonormalizer.FLOAT_FORMAT
        ufonormalizer.FLOAT_FORMAT = None
        self.assertEqual(xmlConvertFloat(1.0000000000000002), '1.0000000000000002')
        self.assertEqual(xmlConvertFloat(1.00000000000000001), '1')
        self.assertEqual(xmlConvertFloat(1.00000000000000019), '1.0000000000000002')
        self.assertEqual(xmlConvertFloat(1e-16), '0.0000000000000001')
        self.assertEqual(xmlConvertFloat(1e-17), '0')
        ufonormalizer.FLOAT_FORMAT = oldFloatFormat
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat_custom_precision(self):
        import ufonormalizer
        oldFloatFormat = ufonormalizer.FLOAT_FORMAT
        ufonormalizer.FLOAT_FORMAT = "%.3f"
        self.assertEqual(xmlConvertFloat(1.001), '1.001')
        self.assertEqual(xmlConvertFloat(1.0001), '1')
        self.assertEqual(xmlConvertFloat(1.0009), '1.001')
        ufonormalizer.FLOAT_FORMAT = "%.0f"
        self.assertEqual(xmlConvertFloat(1.001), '1')
        self.assertEqual(xmlConvertFloat(1.9), '2')
        self.assertEqual(xmlConvertFloat(10.0), '10')
        ufonormalizer.FLOAT_FORMAT = oldFloatFormat
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat(self):
        self.assertEqual(xmlConvertFloat(1.0), '1')
        self.assertEqual(xmlConvertFloat(1.01), '1.01')
        self.assertEqual(xmlConvertFloat(1.0000000001), '1.0000000001')
        self.assertEqual(xmlConvertFloat(1.00000000001), '1')
        self.assertEqual(xmlConvertFloat(1.00000000009), '1.0000000001')
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat(self):
        self.assertEqual(xmlConvertFloat(1.0), '1')
        self.assertEqual(xmlConvertFloat(1.01), '1.01')
        self.assertEqual(xmlConvertFloat(1.0000000001), '1.0000000001')
        self.assertEqual(xmlConvertFloat(1.00000000001), '1')
        self.assertEqual(xmlConvertFloat(1.00000000009), '1.0000000001')
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat_custom_precision(self):
        import ufonormalizer
        oldFloatFormat = ufonormalizer.FLOAT_FORMAT
        ufonormalizer.FLOAT_FORMAT = "%.3f"
        self.assertEqual(xmlConvertFloat(1.001), '1.001')
        self.assertEqual(xmlConvertFloat(1.0001), '1')
        self.assertEqual(xmlConvertFloat(1.0009), '1.001')
        ufonormalizer.FLOAT_FORMAT = "%.0f"
        self.assertEqual(xmlConvertFloat(1.001), '1')
        self.assertEqual(xmlConvertFloat(1.9), '2')
        self.assertEqual(xmlConvertFloat(10.0), '10')
        ufonormalizer.FLOAT_FORMAT = oldFloatFormat
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat_custom_precision(self):
        import ufonormalizer
        oldFloatFormat = ufonormalizer.FLOAT_FORMAT
        ufonormalizer.FLOAT_FORMAT = "%.3f"
        self.assertEqual(xmlConvertFloat(1.001), '1.001')
        self.assertEqual(xmlConvertFloat(1.0001), '1')
        self.assertEqual(xmlConvertFloat(1.0009), '1.001')
        ufonormalizer.FLOAT_FORMAT = "%.0f"
        self.assertEqual(xmlConvertFloat(1.001), '1')
        self.assertEqual(xmlConvertFloat(1.9), '2')
        self.assertEqual(xmlConvertFloat(10.0), '10')
        ufonormalizer.FLOAT_FORMAT = oldFloatFormat
github unified-font-object / ufoNormalizer / tests / test_ufonormalizer.py View on Github external
def test_xmlConvertFloat(self):
        self.assertEqual(xmlConvertFloat(1.0), '1')
        self.assertEqual(xmlConvertFloat(1.01), '1.01')
        self.assertEqual(xmlConvertFloat(1.0000000001), '1.0000000001')
        self.assertEqual(xmlConvertFloat(1.00000000001), '1')
        self.assertEqual(xmlConvertFloat(1.00000000009), '1.0000000001')