Webmastersite.net
Register Log In

trim a custom link field
how to?

Comments on trim a custom link field

david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 19, 2006 - 11:14 AM:

Hey Paul,

I have a custom link integer field. It usually has a 5 digit number as a value, but I need to only display the first 2. The {LINKCUSTOMFIELD[2]> doesn't work. What can I do to make this happen? Any PHP code to help with something like this?

Much appreciated.

David
david
Forum Regular

Usergroup: Customer
Joined: Jun 22, 2005

Total Topics: 91
Total Comments: 305
david
Posted Mar 19, 2006 - 11:18 AM:

Let me rephrase. I just realized that I need to trim all the 0 (zeros) from the value to be displayed instead. I can't just display the first 2 or 3 numbers of the value.

So if I have a value of 1500000, I need to trim the zeros from there and display the 15 only. This doesn't mean I need the values changed in the database, but I need to only display the number 15 when calling up this custom link field.

Thanks
David
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 20, 2006 - 2:42 AM:

<?php echo trim("{LINKCUSTOMFIELD}", "0"); ?>

Actually given the function-calling option of WSN I think {FUNC_TRIM[{LINKCUSTOMFIELD} <,> 0]} should also work.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.