Convert percentage values to clean decimal values

Insert the formula into an agent, change the "Rate" field to whatever field you're targeting and run on selected documents. This will modify documents with values above 1.0 and leave alone values already in the desiried format. The example below show the data conversion. Example: (38.8 to 0.388)
Lotus Formula


FIELD Rate := Rate;

tmp := @Text(Rate);
varLeft := @Left(tmp;".");
varRight := @Right(tmp; ".");

@If(tmp = "" ;
@Success ;
@If(@Contains( tmp ;".") ;
@If(varLeft = "0" ; "";@SetField("Rate"; @TextToNumber("0" + "." + varLeft + varRight ))) ;
@SetField("Rate"; @TextToNumber("0" + "." + tmp ))))

Posted by fbrefere001 on Saturday April 6, 2002