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:
Weird Math and SV (1997)
authenticate broken when url not fully specified? (2000)
HTML Editors (1997)
Nested tags count question (1997)
problem: mail changed (1997)
WebCat2b15MacPlugin - showing [math] (1997)
New WebDNA Example from Olin -- (1998)
[WebDNA] Crashing Database (2011)
Webten + Webcat running smooth (1998)
[SearchString] problem with [search] context (1997)
Which GUI HTML editors work with WC ? (1997)
Setting up shop (1997)
ODBC Problems (2002)
Still Stumped on ShowNext...HELP! (1997)
Overridding E-Mailer (1998)
GuestBook example (1997)
WebCatalog can't find database (1997)
Running a store on BOTH http and https (1998)
problems with 2 tags shakur (1997)
shipcost - cleaner with a table (1998)