Exemplo n.º 1
0
 def count_of_phones(self):
     return round_to_significant_figures(
         sum(area.count_of_phones for area in self.areas), 1)
Exemplo n.º 2
0
 def count_of_phones_likely(self):
     area_estimate = self.simple_polygons.estimated_area
     bleed_area_estimate = self.simple_polygons.bleed.estimated_area - area_estimate
     return round_to_significant_figures(
         self.count_of_phones +
         (self.count_of_phones * bleed_area_estimate / area_estimate), 1)
Exemplo n.º 3
0
def test_round_to_significant_figures(value, significant_figures,
                                      expected_result):
    assert round_to_significant_figures(value,
                                        significant_figures) == expected_result