sorting by currency fields

Post your requests for addons here, and discuss any addons in development here, as well.
Once an addon has completed development, it will be released in the "Addon Release" forum.

Moderator: Spunkmeyer

sorting by currency fields

Postby Stoneage » Tue Feb 27, 2007 7:04 pm

Add-on wishlist item:

In addition to the numeric sorting in the Sort Orders addon, it would be nice to be able to sort using a field containing currency.

Such as from:
$500
$2,500
$10
$200,000

Sorted to:
$10
$500
$2,500
$200,000

I've searched through the forum, but haven't found any addons that already do this. Maybe there's a Perl tweak, but that would be beyond my knowledge level.

Deborah
Stoneage
 
Posts: 52
Joined: Fri Jan 12, 2007 1:07 am
Location: Maine, USA

Postby Dale Ray » Tue Feb 27, 2007 11:31 pm

You shouldn't need perl for this, I think it will work if you just don't enter the $ (dollar sign) in the field. Then in your style use:

$<Field: CustomField_dollarAmount>

replace the fictitious field with your field.
Dale Ray
User avatar
Dale Ray
 
Posts: 1004
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby Stoneage » Wed Feb 28, 2007 4:22 pm

Yes, that certainly works with the example I gave.

I didn't elaborate in my original post, but the fields I am sorting are manually entered by the user with currency ranges such as:

$2,500 to $24,999
$25,000 to $49,999
$50,000 too $74,999

I wouldn't trust the person entering the data to remember to omit the $ on the first number. If they accidentally added a dollar sign, it will through off the sorting.

As a fool-proof method, what I did was to create two entry fields in the Multi-submit profile.
#1 - A standard text field where they can manually type in the range with the dollar signs. (It won't matter what they type here, because the sort is done on #2.)
#2 - A radio button field where they select the range from a list, and I have entered as:
a- $2,500 to $24,999|b- $25,000 to $49,999|c- $50,000 to $74,999

It works, although it seems there must be a more elegant way to do this.
Stoneage
 
Posts: 52
Joined: Fri Jan 12, 2007 1:07 am
Location: Maine, USA


Return to Addon Development and Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron