Jump to content

ehigginbotham

Registered Users - Approved
  • Posts

    34
  • Joined

1 Follower

About ehigginbotham

  • Birthday 05/27/1980

Converted

  • FusionPro Products
    Yes

Converted

  • FusionPro VDP software version
    9.0.3

Converted

  • OS
    Windows 7

Converted

  • Acrobat Version
    Acrobat X (10)

ehigginbotham's Achievements

Contributor

Contributor (5/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

10

Reputation

  1. I need to round off a number. example, my number is 41.25 I want to multiply it by 1.25, and then round it always up to the next 5 increment. so 41.25 x 1.25 = 51.56 I need that number to come out to be 55. I have figured out how to round it, it just doesn't always round up. here is the final rule var x = parseInt(Rule("g1")) var mult = (x*1.25) var z = Math.round(mult / 5) *5 var y = parseInt(z) return y; here is rule G1 var x = parseFloat(Field("AMT")) var z = Math.round(x) var y = parseInt(z) return y; any ideas to make it always round up to the nearest 5 increment in whole numbers?
  2. I have the following rule which works great until the return is not formatted correctly. CustTypeSplit=Field("LASTGIFT").split(".") Number=CustTypeSplit[0] decimal=CustTypeSplit[1] var nocomma= Field("LASTGIFT").replace(/\,/g, ""); var G2=nocomma*1.5 var formattedG2=FormatNumber("#,###.##", G2) if (Number <=19.99) return 40; else return formattedG2; basically, if the number is 19.99 or less, I want it to return 40. if its greater than that I want it to return the number multiplied by 1.5. which works until its a number like 35, which comes out to 52.5. I would like it to return 52.50. I know its something simple in the formatting of it, but I don't know how to do it. Any help would be appreciated.
  3. this seems really dumb, but I can't get this to work now that some of the data has a decimal, and some does not. basically all I need to do this time is have the return be either a whole dolloar... 25 when the data is 25.00, or when the data is $25. also need to be 2.05 if the data is 2.05. or 2.10 if the data is 2.10. the rule above works for all of these instances except for the one that's 2.10, because the data comes in as 2.1 and that's what it sees. I know this should be simple, but its driving me nuts at the moment. any help would be appreciated. thanks
  4. var giftAmount = Field("LASTGIFT").replace(/\$/g, ""); CustTypeSplit=giftAmount.split(".") Number=CustTypeSplit[0] decimal=CustTypeSplit[1] if (giftAmount <= 25) return '25.00'; else if (decimal ==.00) return Number; else return Number +"."+decimal; this wound up working... thank you very much. This forum rocks.
  5. ok, so here is a synopsis of what I'm trying to do. I have a field called last gift, ($xx.xx) is how it is formatted. what I need to do is to make it $25 if its less than $25.00. I also need it not to show the .00 if they are .00, but if it is something like $25.40 to make it show that. here is where I am and I can't get it to work, it always returns $25 no matter the value. var1=Trim(Left(Field("LASTGIFT"),"1")) CustTypeSplit=var1.split(".") Number=CustTypeSplit[0] decimal=CustTypeSplit[1] if (Number<='25') return "25"; else if (decimal ==.00) return Number; else return Number +"."+decimal; any help would be greatly appreciated.
  6. any advice on this if they are all in one field and you need to do the same thing? CITY, STATE ZIP is the filed name.
  7. I am trying to split up a field into the first initials of each word if the string of text is greater than 31 characters. example if the field contains less than 31 characters, return the filed. If it contains more than 31 characters return the first letter of each word in the field. I tried to do a basic split on the " " and I gave it up to 6 possible variable splits. Then I tried to trim the first letter off of each variable split. It works when there are 6 words to split, but it returns an error when there are fewer. There is probably a much easier way to do this, but here is the code I have so far. (I haven't even gotten to checking the field for the number of characters yet, so it there is an easy way to do that, can you throw that in also. CustTypeSplit=Field("NAME1").split(" ") first=CustTypeSplit[0] middle=CustTypeSplit[1] last=CustTypeSplit[2] last2=CustTypeSplit[3] last3=CustTypeSplit[4] last4=CustTypeSplit[5] if (first == "") var1="" else var1=Trim(Left(first, "1")) if (middle == "") var2="" else var2=Trim(Left(middle, "1")) if (last == "") var3="" else var3=Trim(Left(last, "1")); if (last2 == "") var4="" else var4=Trim(Left(last2, "1")); if (last3 == "") var5="" else var5=Trim(Left(last3, "1")); if (last4 == "") var6="" else var6=Trim(Left(last4, "1")); if (Len(Field("NAME1")>=31)) return var1 +" "+ var2 + " " + var3 + " " + var4 + " " + var5 +" "+var6; else return Field("NAME1"); thanks in advance Eric
  8. Can the same idea be used to turn on an unused body page when a field changes? if (FieldChanged(Field("fieldname"))) FusionPro.Composition.SetBodyPageUsage("test",true); Its not working for me, but I just thought it might be useful if it could. thanks
  9. That worked perfectly. What does the g stand for? thanks for your help
  10. I have two data fields that have large numbers in them. I need to subtract one number from the other. they have two decimal places. This sounds simple enough, but I can't get it to work without FP doing some wierd formatting on the numbers, that gives me 17.00 instead of 16855.36. its like it is rounding up the first two numbers. Here is the rule as I have it currently. var account = StringToNumber(Field("ACCOUNT-ENDING")) var company = StringToNumber(Field("COMPANY-ENDING")) var total = account - company return FormatNumber("#####.##",total) // the numbers in the data are //ACCOUNT-ENDING = 66,442.44 //COMPANY-ENDING = 49,587.08 //the result of this function is 17.00 any idea what I am doing wrong?
  11. any ideas why I would be getting "R:\70948-J and 70949-K\FP data\J240B.TXT.pdf" as my name, when my input name is "J 240 B_.TXT"?? I've never tried it off of the input name, but I've had success using static text + fields. I tried taking the spaces and underscore out of my original data name, but no success.
  12. A little different spin on it. I have a file that has about 26000 records in it that go onto three different letters. The data has a field that identifies which letter that it is supposed to apply to. There are about 79 different record types, which are identified by that field. Is there a way in FP to export the files by that field? Our fulfillment department needs them seperated by that field. We have sorted them into order in our mailing software. It just seems very redundent to have to export 79 files out of the mailing software, and then link to 79 different files, and compile them all seperately. any ideas?
  13. I need to write a rule that will name my output file with a static name followed by the date. I would like to add a time stamp to the end of the date so that if I had to run two of these jobs in the same day, the files would not overwrite. I do not see any code for the timestamp. Anyone know what it is? my date rule //date rule var todaysdate = Today(); return (FormatDate(todaysdate, "mmm dd, y")); my rule so far is on the OnNewoutputfile callback rule. //NewOutputFileName rule FusionPro.Composition.outputFileName = "MKT-271/MKT-271" +"_"+ Rule("r_date") + ".pdf"; thanks
×
×
  • Create New...