aboutsummaryrefslogtreecommitdiff
path: root/gerberex
diff options
context:
space:
mode:
authorHiroshi Murayama <opiopan@gmail.com>2019-08-18 18:33:41 +0900
committerHiroshi Murayama <opiopan@gmail.com>2019-08-18 18:33:41 +0900
commitf8fe16708502e0588d9d0be42d097a933d6f12d3 (patch)
tree4b489aa4ba99d96f5f16085d17874e8c4da8b001 /gerberex
parent02258202793e9c70f212171fe4a92f6bab3a6f72 (diff)
downloadpcb-tools-extension-f8fe16708502e0588d9d0be42d097a933d6f12d3.tar.gz
pcb-tools-extension-f8fe16708502e0588d9d0be42d097a933d6f12d3.tar.bz2
pcb-tools-extension-f8fe16708502e0588d9d0be42d097a933d6f12d3.zip
zero supressing in aperture macro definition
Diffstat (limited to 'gerberex')
-rw-r--r--gerberex/am_expression.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gerberex/am_expression.py b/gerberex/am_expression.py
index 4bb1d78..5400130 100644
--- a/gerberex/am_expression.py
+++ b/gerberex/am_expression.py
@@ -49,7 +49,8 @@ class AMConstantExpression(AMExpression):
return self
def to_gerber(self, settings=None):
- return '%.6f' % self._value
+ gerber = '%.6g' % self._value
+ return '%.6f' % self._value if 'e' in gerber else gerber
def to_instructions(self):
return [(OpCode.PUSH, self._value)]