Donnez vie à vos documents numériques !
 

Répondre à : Problème dans le calcul de soustraction. – RÉPONDU

abracadabraPDF Forums PDF – Général Problème dans le calcul de soustraction. – RÉPONDU Répondre à : Problème dans le calcul de soustraction. – RÉPONDU

#55121
Merlin
Maître des clés

Salut,

Il y a 2 façons de faire : protéger le script avant le calcul ou après.
J’ai choisi la 2e possibilité.

Tu as mis :

a = this.getField(« total3.2 »).value;
b = this.getField(« total2.2 »).value;
totalglobal = a-b;
event.target.value = totalglobal;

Que l’on peut protéger ainsi :

a = this.getField(« total3.2 »).value;
b = this.getField(« total2.2 »).value;
totalglobal = a-b;
if (totalglobal > « 0 »)
{
event.target.value = totalglobal;}
else
{event.target.value = «  »;}

:Smiley03: