Calculation Involving Text Strings
Hello,   I am attempting to create a calculation based on two text fields (which actually are numbers in all cases) that were incorrectly designated as these field types. Rather than recreating the fields, I would like to be able to mix in some Javascript in order to convert the text fields to numbers within the calculation itself.   Text Field 1: Pages Issued Text Field 2: Pages Published Formula: Compression Rate = 1 - (@Pages Published / @Pages Issued) Any help would be great. Thanks!  

  • Hi George, you can try to parse the "text numbers" to real numbers before your calculation:  var a = parseInt(@Pages Issued,10);var b = parseInt(@Pages Published,10);1-(b/a) Try this with a new calculation field. Maybe you get an error like "not a valid number". This can occur if field Pages Issuded is empty. If it occury although it's not empty add  || 0 behind each var, like var a = parseInt(@Pages Issued,10) || 0;var b = parseInt(@Pages Published,10) || 0;1-(b/a) Rainer
This question is closed.