bittolas
Forum Replies Created
-
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Limiting output from formulaFor me is ok getting commas, I’m from Portugal and we actually use commas for decimal numbers. I believe that can be the reason since my wordpress is pt-pt version.
I will try to talk with my partner as soon as possible and contact you 🙂
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Limiting output from formulaSorry I’m not very good at explaining
They are 100% the results from the formula.
The thing is I pick the value
$a[ self::$sort_column ]and change it with the function but it’s not saved. The value in the table continues with commas but during the comparison the value that is used it’s with period.It’s like I get a temporary copy of the value with period instead of comma.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Limiting output from formulaI use the number_format to change the value from commas to period just before the comparison in the function compare_rows so no value from the table is changed permanently.
I changed nothing that has to do with formula results.
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Limiting output from formulaThanks!
Since i have some programing knockledge (not in php) I checked the code of the extension row order.
I don’t know if it will be usefull to you but i changed the function compare_rows to this:
public function compare_rows( $a, $b ) { return strnatcasecmp( number_format($a[ self::$sort_column ], 3, '.', ''), number_format($b[ self::$sort_column ], 3, '.', '') );Php Manual: Link
It seems to be working to me.
Hope it helps 🙂
Keep the good work!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Limiting output from formulaHey.
With integer everything goes ok.Sorting goes normally if every value has the same number of digits after comma but if they have less they go to the end/start.
This is the table: Link
I believe the problem is the comma. Any way to change it automatically?Thanks!
Forum: Plugins
In reply to: [TablePress - Tables in WordPress made easy] Limiting output from formulaThanks for the quick response.
That worked as intended however sorting went incorrect.[table id=1 row_order="sort" row_order_sort_column="F" row_order_sort_direction="DESC" /]I have this and my last 4 rows have this values: 0,256 0,37 0,25 0,6
Any way to correct this?