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 :

Testvari column is the result if I reverse the values â??â??xy

Thanks you for help

Pierre-Luc

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 â??â??xy

**Testvari2 column is the result I should get**Thanks you for help

Pierre-Luc

Thanks everyone for your help