[pmwiki-users] pagelist sorting

Hladůvka Jiří mail at revida.sk
Mon Mar 5 15:26:49 CST 2007


Them you have to plan how many digits can be and use leading zeros
300000 for 300,000 books
000025 for 25 books
(stupid, isn't it ?)

Just an idea:
We should need some formatting markups e.g.
(:value {$:var} <oper> <format>:)
(:string  {$:var} <oper> <format>:)

where
    "value" transforms page text variable as string to formatted number
    "string" transforms page text variable as number  to formatted string

    <oper> :=  replace | display
                      replace  {$:var} with the result or
                      displays the result

    <format>  places before decimal comma, places after decimal comma | 
formatting template (e.g. 99 999,99 or Z9 999.99 )

example:
var1:25

(:value {$:var1} display 7,2:) results to 0000025.00 displayed on the page
(:value {$:var1} replace  7,2:) results to 0000025.00 saved to var1 (ROS 
? , on submit ?)

(:string {$:var1} display Z99:) results to 025 displayed on the page
(:string {$:var1} display B9999:) results to &nbsp;&nbsp;&nbsp;25 
displayed on the page
(:string {$:var1} replace  Z99:) results to 025 saved to var1 (ROS ? , 
on submit ?)

May be PHP has different formatting patterns (I'm not php coder) and
a discusion could be useful.

Regards,
Jiri



Jon Haupt napsal(a):
> On 3/5/07, Jiri Hladůvka / OBUTEX <admin at obutex.com> wrote:
>   
>> The sorting is text sorting - consider the digits as characters
>> A. Fish:09
>> B. Fish:10
>> C. Fish:30
>>
>> If the numbers are result of some incrementing then start the numbering
>> from 100 or 1000
>> not to have the same problem when 100 or 1000 arrived
>>
>> Regards
>> Jiri
>>
>>     
>
> In my case, I'm putting in metadata about libraries.  For example,
> Library A has 90 books, Library B has 10,000 books, and Library C has
> 300,000 books.  If I sort by $:Books, I get  BCA, so can I create a
> different kind of sorting that will arrive at ABC?
>
> Jon
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
> __________ Informacia od NOD32 2096 (20070305) __________
>
> Tato sprava bola preverena antivirusovym systemom NOD32.
> http://www.eset.sk
>
>
>
>   




More information about the pmwiki-users mailing list