jamesh

Can't apply math operations in Python Labels

Discussion created by jamesh on Feb 27, 2013
Latest reply on Feb 27, 2013 by dkwiens
Hello,

I'm trying to label point features with numeric values divided by 1000. No matter how I try to do this in Python, it will not work. I tried using 'int' and 'float' on the numeric field in question. no labels ever print unless I leave the value alone. Does anyone have any ideas on how to work around this.  btw works fine in vb or jscript.

def FindLabel ( [sys_loc_code], [end_depth], [cas_rn], [result_numeric], [interpreted_qualifiers]):
UG = float([result_numeric]) /1000
if [cas_rn] == 'PCBH-T':
  return UG + [sys_loc_code]

Outcomes