def _format_float(value):
 value_str = '{:.16G}'.format(value)
 if (('.' not in value_str) and ('E' not in value_str)):
  value_str += '.0'
 elif ('E' in value_str):
  (significand, exponent) = value_str.split('E')
  if (exponent[0] in ('+', '-')):
   sign = exponent[0]
   exponent = exponent[1:]
  else:
   sign = ''
  value_str = '{}E{}{:02d}'.format(significand, sign, int(exponent))
 str_len = len(value_str)
 if (str_len > 20):
  idx = value_str.find('E')
  if (idx < 0):
   value_str = value_str[:20]
  else:
   value_str = (value_str[:(20 - (str_len - idx))] + value_str[idx:])
 return value_str

def _format_float ( value ) : value_str = '{:.16G}' . format ( value ) if ( ( '.' not in value_str ) and ( 'E' not in value_str ) ) : value_str += '.0' elif ( 'E' in value_str ) : ( significand , exponent ) = value_str . split ( 'E' ) if ( exponent [ 0 ] in ( '+' , '-' ) ) : sign = exponent [ 0 ] exponent = exponent [ 1 : ] else : sign = '' value_str = '{}E{}{:02d}' . format ( significand , sign , int ( exponent ) ) str_len = len ( value_str ) if ( str_len > 20 ) : idx = value_str . find ( 'E' ) if ( idx < 0 ) : value_str = value_str [ : 20 ] else : value_str = ( value_str [ : ( 20 - ( str_len - idx ) ) ] + value_str [ idx : ] ) return value_str
format a floating number to make sure it gets the decimal point .