how to sort lines with a $ amount

Jerry Jensen jhj at jhj.com
Mon Mar 31 22:48:21 EDT 2014


If you can really really count on the $ always being present, you could do:
sort the lines of field "myStuff" numeric by char 2 to -1 of word 4 of each

On Mar 31, 2014, 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