def num2strg(num):
 s = str(num)
 if s.endswith('.0'):
  s = s[:(-2)]
 return s

def num2strg ( num ) : s = str ( num ) if s . endswith ( '.0' ) : s = s [ : ( - 2 ) ] return s
attempt to emulate excels default conversion from number to string .