Results 1 to 5 of 5

Thread: XDialog Formating For Dollar Amount

  1. #1
    Member
    Real Name
    Rawlings
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    220

    Default XDialog Formating For Dollar Amount

    Hi Guys,
    How can I format the dollar amount in a keylist_build XDialog box to show the amount from a table like this: $65.00 & not like 65 . I have used the following formating: left(''+ alltrim(str((Payment),10,2,'$'))) but it does not seem to work. What am I doing wrong here. Please help.

    Rawlings

  2. #2
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: XDialog Formating For Dollar Amount

    Hi Rawlings,

    Try str(Payment,10,2,"$")
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  3. #3
    Member
    Real Name
    Rawlings
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    220

    Default Re: XDialog Formating For Dollar Amount

    Hi Keith,
    Your suggestion worked like a charm. The LEFT command was preventing it from working before. Thanks a lot Keith.

    Rawlings.

  4. #4
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,928

    Default Re: XDialog Formating For Dollar Amount

    Rawlings,
    It was much more than just the Left function in which you didn't define the mandatory second argument for number of characters (I used an arbitrary 8).
    I don't know why left was necessary and the only thing having quotes in front of the expression would be to make the rest of the expression character? which the str() function does anyway.
    Code:
    dim payment as n
    payment=65
    ?left(""+ alltrim(str(Payment,10,2,"$")),8)
    = "$65.00"
    Your code needed a few more adjustments to make it work...in red=removed, in blue=added. Removed single quotes, Removed unnecessary parenthesis, Added double quotes, Added left() function's second argument.

    Code:
    left(""''+ alltrim(str((Payment),10,2,"'$'")),8)

    I just did not want you to think that it was just the left() function that was causing your issue.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  5. #5
    Member
    Real Name
    Rawlings
    Join Date
    Mar 2004
    Location
    Washington, DC
    Posts
    220

    Default Re: XDialog Formating For Dollar Amount

    Hi Mike,
    Thanks for your reply. I thought my problem was just the LEFT command, but your reply showed that there was more to it than just the LEFT command. I learned something new from this. Thanks a lot for your help
    Last edited by Rawlings; 04-02-2009 at 12:25 PM.

Similar Threads

  1. Rounding down to the nearest dollar
    By DI-LLC in forum Alpha Five Version 5
    Replies: 4
    Last Post: 03-14-2006, 05:26 PM
  2. Decimal Setup for Dollar amount import
    By spain246 in forum Alpha Five Version 6
    Replies: 6
    Last Post: 07-12-2005, 12:58 PM
  3. FORMATING TEXT IN XDIALOG
    By Rawlings in forum Alpha Five Version 5
    Replies: 0
    Last Post: 09-22-2004, 07:15 AM
  4. Amount in Words
    By Peter Lear in forum Alpha Five Version 5
    Replies: 3
    Last Post: 10-16-2003, 07:05 AM
  5. Dollar Signs gone South $
    By bcsinc in forum Alpha Five Version 4
    Replies: 5
    Last Post: 03-10-2001, 01:57 PM

Bookmarks

Posting Permissions

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