Hi, I'm trying to subtract two integer columns and put the result into a text field. I got good result with positive valuesâ??â??, but I have a problem with negative valuesâ??â??.[ATTACH=CONFIG]16352[/ATTACH]Variation column is the result I get with this formula :
def Resultat(x,y):
diff = x-y
return '%d:%02d' % divmod(diff, 60)
Variation = Resultat( !ScePUPbr! , !SitPUPbr!)
Testvari column is the result if I reverse the values â??â??xyTestvari2 column is the result I should getThanks you for helpPierre-Luc