Search the Community
Showing results for tags 'formatting'.
-
Hello, Can someone walkthrough me through including an inline graphic but also create a rule within that inline graphic to do the following: If the value of a field is yes, then show the graphic; however, if the value of the graphic is no, then don't show the graphic. If someone can help me, I would greatly appreciate it.
-
i'm having trouble Leading Zeros and Zip Code Formatting
andym posted a topic in Issues, Questions, Etc.
I am referencing a list of addresses from an external data file. There are a few addresses in Massachusetts with leading zeros. Once the spreadsheet is put on MarcomCentral, the formatting defaults to drop leading zeros. The rule I wrote for this is below: var Address = ""; var Name = ""; var Street = ""; var City = ""; var State = ""; var Zip = ""; var Country = ""; myXDF= new ExternalDataFileEx("ATLocations.txt", "\t"); for (i = 1; i < myXDF.recordCount+1; i++) { FirstVar = myXDF.GetFieldValue(i, 0); { if (FirstVar==Field("Address")) { Name = myXDF.GetFieldValue(i, 1); Street = myXDF.GetFieldValue(i, 2); City = myXDF.GetFieldValue(i, 3); State = myXDF.GetFieldValue(i, 4); Zip = myXDF.GetFieldValue(i, 5); Country = myXDF.GetFieldValue(i, 6); } } } return ' | ' + City+", "+State+" "+FormatNumber("00000", Zip); The last part of the returned text is the zip code. In previous templates this seemed to work for me, but I am now getting different results, i.e." MA, 1913 00000" where it drops the leading zero and puts five zeros after the actual zip code. Finally, one extra item that we need to work. There are also Canadian addresses. Whatever rule(s) we use also needs to work for those locations. Now, the result looks like this: "Ontario, L6T 3V1 00000." Is the rule I have on the right track? Should the zip code part be left out and made into an independent rule? Any help is greatly appreciated. Thank you, Andy- 4 replies
-
- code
- formatting
-
(and 2 more)
Tagged with:
-
I'm trying to figure out how to write a phone formatting rule that will allow for this format: 336 876 9876 I was trying this out below but had some issues if an extension was present or if there was no area code. I'm completely in the dark when it comes to coding! HALP:) var str = Field("Phone");//Phone var newStr = str.replace(/\s+/g, ''); return Left(newStr,3) + " " + Left(Right(newStr,6),3) + " " + Right(newStr,4); Thanks in advanced! Hilary
- 5 replies
-
- formatting
- phone
-
(and 2 more)
Tagged with:
-
I am sure this has been asked and discussed in maybe a different way. But I have search the forums and can't find a simple solution. I have 5 data fields with dollar amounts in them. None have commas, or dollar signs. In a perfect world I would just use the Number to Currency wizard for all 5 fields that FusionPro gives however.... Not all the data in those fields are numbers, some is text and they change whereas sometimes the "Other $_______ may be in field named AMT1 position. Example: Amt1= 25 Amt2= 50 Amt3=75 Amt4=100 Amt5=Other $________ Example2: Amt1= Other $________ Amt2=(Blank--will be suppressed) Amt3=(Blank--will be suppressed) Amt4=(Blank--will be suppressed) Amt5=(Blank--will be suppressed) Example3: Amt1= 25 Amt2= 50 Amt3=Other $________ Amt4=(Blank--will be suppressed) Amt5=(Blank--will be suppressed) I need to make it where the rule searches the field for numbers only and convert to currency formatting. And if it has text do not format.
- 1 reply
-
- formatting
- javascript
-
(and 1 more)
Tagged with: