[scribus] adding values in a custom calculation script

Gregory Pittman gpittman at iglou.com
Tue Jun 21 11:12:50 UTC 2016


On 06/21/2016 01:56 AM, Georgia Christakos wrote:
> Hi,  I hope someone can help me with my question.  I am creating an
> interactive Pdf file and have created a custom calculation script to
> calculate the "difference" in some fields within my file eg Text 1 - Text 2
> 
> However,  when I go to sum these values into a separate Summary Table, the
> values do not calculate correctly.  It seems that the sum function in
> Scribus does not see these values as a fixed number, but as a formula and
> continues to add/deduct them from the overall total.  
> 
> Has anyone had this problem before and any ideas on how to fix it?
> 
> Below is an example of my custom calculation script. 
> var v1=getField("TotalBudgetEstimate2").value;var
> v2=getField("TotalQuotedPrice2").value;event.value=v2-v1
> 

I can't quite tell from what you show, but it may be that you need to
convert strings to numbers for this to work.
For example, if you enter anything with a valueDialog, python interprets
it as a string.

Greg




More information about the scribus mailing list