summaryrefslogtreecommitdiff
path: root/gerbonara/gerber/cam.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-01-30 15:07:55 +0100
committerjaseg <git@jaseg.de>2022-01-30 15:07:55 +0100
commitc8bf837a4b5dcc6242b7dac383f09e9390deca35 (patch)
tree1c6d5f407e3276aad8304ef61fd81967c97a95b2 /gerbonara/gerber/cam.py
parent8bf6420cb4c8696487fe0fef5b5e154d262041b2 (diff)
downloadgerbonara-c8bf837a4b5dcc6242b7dac383f09e9390deca35.tar.gz
gerbonara-c8bf837a4b5dcc6242b7dac383f09e9390deca35.tar.bz2
gerbonara-c8bf837a4b5dcc6242b7dac383f09e9390deca35.zip
Fix some more testcases
* Fix Excellon export among others
Diffstat (limited to 'gerbonara/gerber/cam.py')
-rw-r--r--gerbonara/gerber/cam.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/gerbonara/gerber/cam.py b/gerbonara/gerber/cam.py
index 6c6a7dc..4c8ab19 100644
--- a/gerbonara/gerber/cam.py
+++ b/gerbonara/gerber/cam.py
@@ -147,11 +147,13 @@ class FileSettings:
if self.zeros == 'leading':
value = '0'*decimal_digits + value # pad with zeros to ensure we have enough decimals
- return float(sign + value[:-decimal_digits] + '.' + value[-decimal_digits:])
+ out = float(sign + value[:-decimal_digits] + '.' + value[-decimal_digits:])
else: # no or trailing zero suppression
value = value + '0'*integer_digits
- return float(sign + value[:integer_digits] + '.' + value[integer_digits:])
+ out = float(sign + value[:integer_digits] + '.' + value[integer_digits:])
+ print(self.zeros, self.number_format, value, out)
+ return out
def write_gerber_value(self, value, unit=None):
""" Convert a floating point number to a Gerber/Excellon-formatted string. """