Jump to content

Adding bullets to business cards


lgarrison

Recommended Posts

trying to add bullets before Fax and Cell phone when they're available. It's showing for the Cell but not fax. Any thoughts?

 

var fax = Rule("Change fax phone format Rule");

var cell = Rule("Change Cell phone format Rule");

 

var numbers = ["Fax: " + fax,"Cell: " + cell];

 

return numbers.filter(function(m){return m.match(/.*\s(?=.)/);}).join(" • ");

Link to comment
Share on other sites

It's not working because you're using the join method.

 

Try this:

var fax = Rule("Change fax phone format Rule");
var cell = Rule("Change Cell phone format Rule");

var result = "";
if (fax)
 result += '• Fax: ' + fax + ' ';
if (cell)
 result += '• Cell: ' + cell;
return Trim(result);

 

Or:

var fax = Rule("Change fax phone format Rule");
var cell = Rule("Change Cell phone format Rule");
return ["Fax: " + fax,"Cell: " + cell].map(function(s){ return /^.*\s\w+$/.test(s) ? '• ' + s : ''; }).filter(String).join(' ');

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...