> -----Alkuper�inen viesti-----
> L�hett�j�: Jan Schenkel [mailto:[EMAIL PROTECTED]]
> L�hetetty: 14. lokakuuta 2002 14:57
> Vastaanottaja: [EMAIL PROTECTED]
> Aihe: Re: desimal numbers calculation
> 
> 
> --- Esa_Kivel� <[EMAIL PROTECTED]> wrote:
> > Greetings
> > 
> > Some newbie question:
> > 
> > I tried to calculate desimal numbers in RR but how
> > can code some calculation. 
> >  
> > In the card I have some text filed where users put
> > some numbers like 0,5, 3,4 and so on. 
> >  
> > In some field I'd like to show those fields result
> > as ie. 0,5 + 3,4 and so on but that + operator in
> > the script won't calculate desimal numbers. 
> >  
> > Is there any other way to sum those desimal numbers?
> > 
> >  
> > Yours 
> >  
> > EsaK 
> >
> 
> Hi Esa,
> 
> RunRev expects numeric data to have a decimal point.
> Therefore, you'll have to convert between 'display'
> and 'calculation' format before and after calculation.
> If you don't need thousand separators, then it's as
> easy as:
>   function Conv4Disp pNumber
>     replace "." with "," in pNumber
>     return pNumber
>   end Conv4Disp
>   function Conv4Calc pNumber
>     replace "," with "." in pNumber
>     return pNumber
>   end Conv4Calc
> 
> Hope this helped,

More simple that that is this code. Some text field calulates others text fields 
desimal numbers "on the fly":

on idle
  set the itemdel to ","
  put item 1 of field "seitsem�n" + item 1 of field "kahdeksan" + \
      item 1 of field "yhdeks�n" + item 1 of field id 1028 + item 1 of field id 1027 \
      + item 1 of field "kaksitoista" + item 1 of field "kolmetoista" \
      + item 1 of field "nelj�toista" + item 1 of field "viisitoista" \
      + item 1 of field "kuusitoista" + item 1 of field "seitsem�ntoista" into field 
"18"
  
end idle

And itse works!

Many tahnks for help to the those who answer to my problem :-)

EsaK
_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to