diff options
Diffstat (limited to 'gerbonara/gerber/cam.py')
-rw-r--r-- | gerbonara/gerber/cam.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gerbonara/gerber/cam.py b/gerbonara/gerber/cam.py index 12906a0..f42c24d 100644 --- a/gerbonara/gerber/cam.py +++ b/gerbonara/gerber/cam.py @@ -92,8 +92,11 @@ class FileSettings: else: # no or trailing zero suppression return float(sign + value[:integer_digits] + '.' + value[integer_digits:]) - def write_gerber_value(self, value): + def write_gerber_value(self, value, unit=None): """ Convert a floating point number to a Gerber/Excellon-formatted string. """ + + if unit is not None: + value = self.unit.from(unit, value) integer_digits, decimal_digits = self.number_format |