Re: Sorting Number with commas
This WebDNA talk-list message is from 2001
It keeps the original formatting.
numero = 39663
interpreted = N
texte = You're referring to numeric values stored in a database with formatting? i.e. 25,123 rather than 25123?I'm afraid this isn't going to work well for you. If you need to sort on a numeric field, you need to store it without formatting.As I understand it, specifying sort type of num is essentially the same as running the value through a [math] context before sorting. Try it with a comma formatted number... I get:[math]25,123[/math] --> 123It appears that [math] gives you the last value from a comma delimited list. I didn't expect that, since:[math]25x123[/math] --> 25Interesting... but kinda beside the point.The point is, store numeric values raw, and format them when you need to display them.- brianAt 10:01 AM -0600 10/25/2001, Joseph Sullivan wrote:>I must be doing something wrong here.>>How do i get number with commas in them to sort right?>>When I have numbers with commas in them, they sort funny.>>Any thing I am missing?-- <= Brian C. Fries, BrainScan Software http://www.brainscansoftware.com =>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
You're referring to numeric values stored in a database with formatting? i.e. 25,123 rather than 25123?I'm afraid this isn't going to work well for you. If you need to sort on a numeric field, you need to store it without formatting.As I understand it, specifying sort type of num is essentially the same as running the value through a [math] context before sorting. Try it with a comma formatted number... I get:[math]25,123[/math] --> 123It appears that [math] gives you the last value from a comma delimited list. I didn't expect that, since:[math]25x123[/math] --> 25Interesting... but kinda beside the point.The point is, store numeric values raw, and format them when you need to display them.- brianAt 10:01 AM -0600 10/25/2001, Joseph Sullivan wrote:>I must be doing something wrong here.>>How do i get number with commas in them to sort right?>>When I have numbers with commas in them, they sort funny.>>Any thing I am missing?-- <= Brian C. Fries, BrainScan Software http://www.brainscansoftware.com =>-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Brian Fries
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Showif, Hideif reverse logic ? (1997)
[WebDNA] Create a cryptographic Mac key... (2016)
Webcatalog server support (1997)
executive server side java within webDNA (1997)
[OT] (waaaay OT) further off topic than before (2004)
WebCat2 several catalogs? (1997)
select multiple (1997)
WebCat2b15MacPlugin - [protect] (1997)
supressing math results (1997)
Can you do this??? and other stuff (1997)
Extended [ConvertChars] (1997)
Add to Cart & List of Products (1997)
email server and webdna (2006)
& in Lookups (1997)
Test (2003)
[UPPERCASE] (1997)
Other Databases, access, filemaker etc. (2000)
PCS Frames-Default page is solution! (1997)
SSL/Document Contains NO Data (1998)
[WebDNA] Barcode (2014)