Donnez vie à vos documents numériques !
 

Répondre à : Réduction fraction

abracadabraPDF Forums PDF – Général Réduction fraction Répondre à : Réduction fraction

#69376
bebarth
Maître des clés

Hi,

var t1 = this.getField (“Number1”). valueAsString;
var t2 = this.getField (“Number2”). valueAsString;
var t3 = t1 + “/” + t2;
this.getField (“Text1”). value = simplify (t3);

This is one of possibilities, but you can directly write:
this.getField (“Text1”). value = simplify (t1+”/”+t2); // without the t3 variable
or more directly:
this.getField (“Text1”). value = simplify (this.getField (“Number1”). value+”/”+this.getField (“Number1”). value); // without any variable
No need to use valueAsString.

I will be back a bit later to give both of you other ways and to explain the script.
@michel.c: do you quite well speak English ?

@+
:bonjour: