Results 1 to 4 of 4

Thread: 'format' function

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    does anybody know the format character for 'display if present' ?

    Example::

    Format("hi","xxxxx") would yield " hi"

    what I need the is 'x' that makes that possible, also if there is one for numbers too, that would be great, ex.

    Format(32.45,"$99990.00") would yield "$ 32.45"



    Thanks in advance.

  2. #2
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    your second example works like this

    Debug.Print Format(32.45, "$0.00")

    as for the first I don't know
    you could do this to limit the length

    debug.print left$("My Text",6)

    Kurt Simons
    [I know I'm a hack but my clients don't!]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    okay, so I forgot to include the code tags in my first post, here it is again

    Code:
    format("hi","xxxxx") would yield "   hi"
    
    and 
    
    format(32.45,"$99990.00") would yield "$   32.45"
    any ideas?

  4. #4
    Fanatic Member
    Join Date
    Jul 2000
    Location
    Manchester NH
    Posts
    833
    Format("safdsfd", "@@@@@@@@@@@@@@@@@@")



    MSDN
    User-Defined String Formats (Format Function)
    Kurt Simons
    [I know I'm a hack but my clients don't!]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width