What version of Ditto are you running?
I’m using that latest version - not the svn. 2.1.0 I believe.
What happens to the sorting exactly when you add the comma? Also, if you could provide the debug data, that would aide in solving this issue.
Ditto is placing the values with commas at the bottom of a DESC list. Attached is the debug info.
Quote from: cbaone at May 23, 2008, 10:49 AM...
Well, the tv sorting works until there’s a comma in one of the tv’s like 1,200...
Maybe I’m way off base here, but this seems like a simple matter of how the SQL statement is run. In the ORDER BY clause of an SQL statement, you can have multiple orderings, e.g.
... ORDER BY last_name ASC, first_name ASC, state
So if you put in commas, then the query assumes that it has multiple sort by criteria (first/last name, and state in my example). Very often in snippet parameters, the parameter values are no more than query pieces as I would expect in this case. I guess Mark would be the authority on this one though.
Standard Disclaimer
I could be totally wrong.
jaredc,
Thanks for the response. Like I said, everything is working as expected with Ditto, but when creating a page where the tv is specified, if the user puts in a comma for a value (e.g., Value in Dollars: 5,346) and all the other values don’t have a comma the value with the comma is displayed at the bottom of the results.
Value in Dollars:
Item 1 432
Item 2 413
Item 3 376
Item 4 179
Item 5 65
Item 6 5,346
So it’s sorting everything based on the tvs - sorting it correctly except for the values with commas. These aren’t ditto parameters or anything, but the tvs themselves.
It seems that the comma is treated as a decimal rather than thousands. I wonder if this could be a localization issue since some countries use the commas and decimals reversed.
An option may be to ask that the users input numbers without commas and add them back in with a phx modifier for display.
I looked through the PHx documentation, but can’t find anything that explicitly states how to add a comma in later.
[+value: ....ahh, forget it I just wouldn’t know where to begin. How can I use PHx to add the comma in later?