Results 1 to 3 of 3

Thread: % sign

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    68

    % sign

    sprintf(Percentage, "Completed - %5.2f %",(Value/Max)*100);

    How do I get the second % sign to go into my string?

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Not sure, but I guess you should use the escape character (\)

    So that would be

    Code:
     sprintf(Percentage, "Completed - %5.2f \%",(Value/Max)*100);
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    % is _vsnprintf specific so try %%. (it's not escaped by the compiler)
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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