Suppress leading zeros


Results 1 to 5 of 5

Threaded View

  1. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Post

    Hi,

    suppose we have 4 digits ...

    IF Value < 1000 ... first digit = 0 ... so, do not show it ( or print blank ! )
    IF Value < 100 ... second digit = 0 ... so, do not show it
    IF Value < 10 ... Third digit = 0 ...

    or use a flag ...

    for digit 1 to 4

    IF Digit = 0 AND Flag = 0 then

    ... do not show it : Flag = 0

    ELSE

    ... Show it : Flag = 1

    ENDIF

    Next digit

    Alain
    Last edited by Acetronics2; - 24th June 2008 at 17:08.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Can we suppress leading zero's in LCDOUT?
    By PICn-It in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th December 2009, 17:09
  2. Leading 0's or BCD
    By RYTECH in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th December 2005, 02:06
  3. max7219 blank leading zeroes
    By lutherblissett in forum General
    Replies: 0
    Last Post: - 13th November 2005, 17:46

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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