rutetuti
Založený: 23.04.2009
Príspevky: 1
Zaslal: 2009-04-27 20:53
Návrat hore
Odpovedať s citátom
|
Hi,
I have a "price" field that is defined below,
$opts['fdd']['price'] = array(
'name' => 'Price £;',
'select' => 'N',
'maxlen' => 10,
'sort' => true
);
When I run a query this sorts perfectly. However, I wanted to add the thousand separator and also a GB pound symbol, but if I add the following then the field gets sorted as a string so that, for instance, £100,000 is listed as less than £50,000.
$opts['fdd']['price']['sql|LF'] =
'if(price <> "0.00", CONCAT("£", FORMAT(price, 0)), price)';
any ideas how I can keep my GB pound symbol and separator but have it sort as an integer?
thanks
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2009-04-29 14:28
Návrat hore
Odpovedať s citátom
|
I wonder if it would function differently if phpMyEdit's number_format option were used, instead of MySQL's FORMAT.
| Kód: |
| $opts['fdd']['price']['number_format'] = array(2, '.', ','); |
Also, is the desired sort available if the pound sign appears after the price? Perhaps you could use a dummy / virtual field to display the pound sign.
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|