Re: right justify left zero fill



On Fri, 28 Oct 2005 05:35:03 -0700, Stan wrote:

>I have to build a text file with a dollar amount that must be right
>justified, left zero filled and no decimal. The field I am extracting data
>from is 'amount' and defined as decimal 9(15,2).

Hi Stan,

You can use the following expression:

RIGHT(REPLICATE('0', 11) + LTRIM(CAST(YourColumn * 100 AS INT)), 11)

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
.



Relevant Pages

  • Data Validation with Formula
    ... I'm using data validation for columns B, C, and D. I would like to do ... the dollar amount would be the same for all entries on that row). ... SAMPLE WORKSHEET ... Prev by Date: ...
    (microsoft.public.excel.misc)
  • XY Scatter with Custom Labels
    ... I have a list of products, each with an X (a dollar amount) and a Y ... hatzipet's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27891 ... Prev by Date: ...
    (microsoft.public.excel.charting)
  • I want a series of letters to equal a dollar amount?
    ... How do I create a conditional formula that will = a dollar amount and move ... the row to another worksheet? ... Prev by Date: ...
    (microsoft.public.excel.misc)
  • How do I calculate a total amount on a form in Access.
    ... I am doing a Purchase Order form and I would like to calculate the "Total ... Dollar Amount" of my items. ... Adickson ... Prev by Date: ...
    (microsoft.public.access.forms)
  • Re: Sleeping in Light
    ... It depends on the specific usage. ... > Would it be "Fair" to say every citizen has the same dollar amount in tax ... Prev by Date: ...
    (rec.arts.sf.tv.babylon5.moderated)