Pi-Hellz

Calculate Field - Unsupported operand types integer

Discussion created by Pi-Hellz on Jun 8, 2012
Latest reply on Jun 8, 2012 by JScheirer-esristaff
Hello,

I'm trying to convert this vba formula (Decimal time to mm:ss) in Python but i'm having a lot of trouble with the error 000539.

Dim Heures, Minutes,Temps as single
Dim Resultat as String

Temps = [Pe_Decimal]
Heures = Int( Temps /60)
Minutes = Round(((( Temps /60)-Heures)*60),0)
Resultat= Cstr(Heures) & ":" & Right(("00" & Cstr(Minutes)),2)

__esri_field_calculator_splitter__
Resultat



When the field calculator is working without any errors, my field is still empty.

def Resultat(x):
 Temps = str(x)
 Heures = int(Temps / 60)
 Minutes = round((((Temps / 60) - Heures) * 60), 0)
 Resultat = Heures + ":" + right(("00" + Minutes))


[ATTACH=CONFIG]15066[/ATTACH]

Thanks you

Pierre-Luc

Attachments

Outcomes