@@ -45,7 +45,7 @@ class EngUnit:
4545 Represents an engineering number, complete with units
4646 """
4747 def __init__ (self , value ,
48- precision = 2 , significant = 0 , unit : str = None ):
48+ precision = 2 , significant = 0 , unit : str = None , separator = "" ):
4949 """
5050 Initialize engineering with units
5151 :param value: the desired value in the form of a string, int, or float
@@ -70,10 +70,10 @@ def __init__(self, value,
7070 if self .unit is None and len (value ) >= v_index :
7171 self .unit = value [v_index :]
7272
73- self .eng_num = EngNumber (new_value , precision , significant )
73+ self .eng_num = EngNumber (new_value , precision , significant , separator )
7474
7575 else :
76- self .eng_num = EngNumber (value , precision , significant )
76+ self .eng_num = EngNumber (value , precision , significant , separator )
7777
7878 def __repr__ (self ):
7979 """
@@ -282,7 +282,7 @@ class EngNumber:
282282 """
283283
284284 def __init__ (self , value ,
285- precision = 2 , significant = 0 ):
285+ precision = 2 , significant = 0 , separator = "" ):
286286 """
287287 Initialize the class
288288
@@ -294,6 +294,7 @@ def __init__(self, value,
294294 """
295295 self .precision = precision
296296 self .significant = significant
297+ self .separator = separator
297298
298299 if isinstance (value , str ):
299300 suffix_keys = [key for key in _suffix_lookup .keys () if key != '' ]
@@ -332,7 +333,7 @@ def to_pn(self, sub_letter=None):
332333 return string
333334
334335 letter = string [- 1 ]
335- return string .replace ('.' , letter )[:- 1 ]
336+ return string .replace ('.' , letter )[:- 1 ]. strip ( self . separator )
336337
337338 def __repr__ (self ):
338339 """
@@ -375,7 +376,7 @@ def __repr__(self):
375376 if '.00' in base :
376377 base = base [:- 3 ]
377378
378- return base + _exponent_lookup_scaled [exponent ]
379+ return base + self . separator + _exponent_lookup_scaled [exponent ]
379380
380381 def __str__ (self , eng = True , context = None ):
381382 """
0 commit comments