Can we suppress leading zero's in LCDOUT?


Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Nov 2009
    Posts
    19

    Default Can we suppress leading zero's in LCDOUT?

    I'm trying to print a value in a BYTE sized VAR to a specific place on the LCD.
    (a standard 16x2, and using DT's Anypin.php)

    I need to get the number right-justified and w/o leading zero's.

    I currently have a 0-255 number comming from the ADC on AN0.

    (later I will need to do some math and expand the the result to Xnum-per-mV)

    I'm currently doing something like this:

    Code:
    MYNUMBER VAR BYTE
    MYNUMBER = 0
    ...
    ADCIN 0, MYNUMBER
    ...
    LCDOUT $FE, $83, DEC MYNUMBER
    and it prints out "127 " instead of " 127" on the LCD.

    My number needs to be printed before (in front of) some text that remains on the LCD during these numeric updates, like " 127-Dingles".

    I tried DEC5 and get the digits in the right place but they have leading zero's (instead of spaces)

    Is there a way to format my number right-justified and suppress the leading zero's?
    Last edited by PICn-It; - 16th December 2009 at 00:14.

Similar Threads

  1. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  2. Suppress leading zeros
    By Adrian in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 24th June 2008, 21:45
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 02:33
  4. Crystalfontz LCD
    By jman12 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 9th February 2007, 15:04
  5. having problems with Hantronix 20x4 lcd
    By Rhatidbwoy in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 22nd December 2005, 12:22

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