<![CDATA[ GetResources: sortBy TV problem with numbers - My Forums]]> https://forums.modx.com/thread/?thread=39256 <![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers?page=2#dis-post-564158

Did you mean the decimal output modifier? I'm not aware of any Decimal snippet or extra with that name.
]]>
BobRay Feb 20, 2019, 06:02 AM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers?page=2#dis-post-564158
<![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers?page=2#dis-post-564152 Quote from: BobRay at Dec 22, 2018, 06:22 AM
What snippet?

The Decimal snippet. Thanks Bob.]]>
recordingclub Feb 19, 2019, 09:06 PM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers?page=2#dis-post-564152
<![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers?page=2#dis-post-563350 BobRay Dec 22, 2018, 06:22 AM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers?page=2#dis-post-563350 <![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563319 Quote from: BobRay at Dec 19, 2018, 03:36 AM
I really thought that would do it:

case 'decimal':
     $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS DECIMAL) AS sortTV");
     break;


Does your TV value begin with a dollar sign? That could interfere with the sorting process.

No, it does not start with the dollar sign. This snippet did the trick. Thank you!]]>
recordingclub Dec 19, 2018, 01:46 PM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563319
<![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563312
case 'decimal':
     $criteria->select("CAST(IFNULL(tvSort.value, tvDefault.default_text) AS DECIMAL) AS sortTV");
     break;


Does your TV value begin with a dollar sign? That could interfere with the sorting process.]]>
BobRay Dec 19, 2018, 03:36 AM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563312
<![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563310
Quote from: BobRay at Dec 18, 2018, 07:55 PM
Try adding this to the getResources tag:

&sortbyTVType=`decimal`
]]>
recordingclub Dec 18, 2018, 08:30 PM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563310
<![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563308
&sortbyTVType=`decimal`
]]>
BobRay Dec 18, 2018, 07:55 PM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563308
<![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563296 recordingclub Dec 17, 2018, 07:41 PM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-563296 <![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-226383
Thank for the help, but is doesn’ work. &includeTVs=`1`, &tvPrefix=`tv.` and &processTVs=`1` are included.

Any other sugestions? It seems that GetResources "see" the number 10 as 1, or "see" numbre 9.5 as 95.

cheers.]]>
logiag Feb 14, 2011, 10:00 AM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-226383
<![CDATA[Re: GetResources: sortBy TV problem with numbers]]> https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-226382 BobRay Feb 13, 2011, 11:42 PM https://forums.modx.com/thread/39256/getresources-sortby-tv-problem-with-numbers#dis-post-226382