Re: Stupid Format grrrrrrrr....

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 58929
interpreted = N
texte = At 11:52 AM +0100 7/30/04, Alan White wrote: >What on earth am I doing wrong here? > >[format 4s][ID][/format] - [myValue] > >I want this to return a number between 1 & 4 chars long but it isn't doing do.... I did the format as a string as it doesn't need formated with regards to thousands / numbers etc... I just want things to align nicely on my search results. > >Any help appreciated ... I know this one has to be easy and I am missing it :( Two things. In a format string "s" assumes alphanumeric characters and so the output is always left justified with spaces padded on the right. On the other hand, "f" assumes a numeric value and is right justified. Secondly, runs of spaces are stripped by browsers. You need to use "f" in your format string if [ID] is a number and you need to wrap the whole thing in
 tag. Like this:
[format 4.0f]1[/format][format 4.0f]11[/format][format 4.0f]111[/format][format 4.0f]1111[/format]
The "Hello" example in the docs is clear that "s" is left justified. ~joe ------------------------------------------------------------- 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://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Stupid Format grrrrrrrr.... ( Alan White 2004)
  2. Re: Stupid Format grrrrrrrr.... ( Joe D'Andrea 2004)
  3. Stupid Format grrrrrrrr.... ( Alan White 2004)
At 11:52 AM +0100 7/30/04, Alan White wrote: >What on earth am I doing wrong here? > >[format 4s][ID][/format] - [myValue] > >I want this to return a number between 1 & 4 chars long but it isn't doing do.... I did the format as a string as it doesn't need formated with regards to thousands / numbers etc... I just want things to align nicely on my search results. > >Any help appreciated ... I know this one has to be easy and I am missing it :( Two things. In a format string "s" assumes alphanumeric characters and so the output is always left justified with spaces padded on the right. On the other hand, "f" assumes a numeric value and is right justified. Secondly, runs of spaces are stripped by browsers. You need to use "f" in your format string if [ID] is a number and you need to wrap the whole thing in
 tag. Like this:
[format 4.0f]1[/format][format 4.0f]11[/format][format 4.0f]111[/format][format 4.0f]1111[/format]
The "Hello" example in the docs is clear that "s" is left justified. ~joe ------------------------------------------------------------- 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://webdna.smithmicro.com/ Joe D'Andrea

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:

RE: Help name our technology! (1997) FYI-WebCat Mac or NT (1997) RE: [redirect] w/o showing args? (1999) Upgrading old WebCat Database Files (1997) How can I Add several Items into the cart at once? (1997) form data submission gets truncated (1997) WebDNA tags in WebMerchant email templates ... (1997) WCS Newbie question (1997) truncating email part II (1997) RE: Multiple Stores and WebCatalog Prefs (1997) RE: [WebDNA] How to valuate a domain name? (2010) Every other record deleted (2005) question: webmerchant connection (1997) [carts] and databases (1997) [referrer] tag (1997) Whats going on with my SERIAL NUMBER??? (1998) Protect (1997) Back to Authnet with storebuilder (2003) WebCat b13 CGI -shownext- (1997) searches with dash, period etc. (2000)