+ Reply to Thread
Results 1 to 3 of 3

Keep Trailing Zeros When Convert To Text

  1. #1
    Todd G
    Guest

    Keep Trailing Zeros When Convert To Text

    Is there a way any one knows about to keep the 00 portion with the dollar
    amount when you convert to a text format.
    e.g. $234.00 converted to text to be 23400, not like it automatically does
    234.

    The other amounts where there are actual cents work fine as we all know, but
    I need everything, no matter if there are pennies or not.

  2. #2
    Dave Peterson
    Guest

    Re: Keep Trailing Zeros When Convert To Text

    It sounds like you're not just saving as a text file (.txt or .prn).

    I like to use helper columns and put formulas in that make it what I want:

    =text(a1*100,"000000")

    for instance.

    Not knowing what you're doing....

    Are you trying to create a fixed width text file?

    If you are, you could concatenate the cell values into another column:

    =LEFT(A1&REPT(" ",5),5) & LEFT(B1&REPT(" ",4),4) & TEXT(C1*100,"00000000")

    (You'll have to modify it to match what you want.)

    Drag it down the column to get all that fixed width stuff.

    Then I'd copy and paste to notepad and save from there. Once I figured out that
    ugly formula, I kept it and just unhide that column when I wanted to export the
    data.

    If that doesn't work for you, maybe you could do it with a macro.

    Here's a link that provides a macro:
    http://google.com/groups?threadm=015...280a%40phx.gbl

    Todd G wrote:
    >
    > Is there a way any one knows about to keep the 00 portion with the dollar
    > amount when you convert to a text format.
    > e.g. $234.00 converted to text to be 23400, not like it automatically does
    > 234.
    >
    > The other amounts where there are actual cents work fine as we all know, but
    > I need everything, no matter if there are pennies or not.


    --

    Dave Peterson

  3. #3
    Stefi
    Guest

    RE: Keep Trailing Zeros When Convert To Text

    =TEXT(A1,"0.00") gives 234.00!
    If you really don't need decimal point, then
    =SUBSTITUTE(TEXT(A1,"0.00"),".","")

    Regards,
    Stefi


    „Todd G” ezt *rta:

    > Is there a way any one knows about to keep the 00 portion with the dollar
    > amount when you convert to a text format.
    > e.g. $234.00 converted to text to be 23400, not like it automatically does
    > 234.
    >
    > The other amounts where there are actual cents work fine as we all know, but
    > I need everything, no matter if there are pennies or not.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1