how to sort lines with a $ amount

Paul Hibbert paulhibbert at mac.com
Tue Apr 1 04:54:40 CEST 2014


If the $amount is always the last column in the field…

   set the itemDel to "$"
   sort lines of fld "myField" ascending numeric by item 2 of each

Paul

On 2014-03-31, at 7:03 PM, larry at significantplanet.org wrote:

> I have a field with a date, name, number and finally a dollar amount such as $10 - in each line of the field.
> 
> I can sort the lines of the field just fine on word 1 (date),  word 2 (name) and word 3 (number)
> 
> But when I try to sort on word 4, I don't know how to get it to come out right because the $ in front makes it a string and not a number.
> 
> So I get something like this:
> $11.00
> $120.00
> $47.00
> 
> When what I want is:
> $11.00
> $47.00
> $120.00
> 
> Thanks in advance for any enlightenment!
> Larry
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list