extracting a decimal and zero filling a field 
Author Message
 extracting a decimal and zero filling a field

Hi,

Thanks to Paul for his answer to my previous question about zero filling the
document_number field.  I also have to zero fill an amount
field(document_amount), and I also have to remove the decimal point from
this document_amount field, but keep the numbers which were to the right of
the decimal point.  When I zero fill the field before removing the decimal,
crystal removes the decimal point and the numbers to the right of the
decimal as well.  I would like to remove the decimal point from the field,
and then zero fill, but I can't figure out how to do it.  I'm new to
Crystal,  and I have a feeling there's a very simple way to accomplish
this(as there was in my previous question, where I was overcomplicating it).

Can anyone help?

Thanks very much.

Sue



Sun, 29 Dec 2002 03:00:00 GMT  
 extracting a decimal and zero filling a field
Hi Sue, you're welcome.  This one is pretty straightforward also:


    ToText( {Table.document_amount} * 100, "0000000000")

Multiplying the amount by 100 should get you the digits to the right of the
decimal point and then you pass that result to ToText to zero-fill the
value.

HTH, Paul
--
Paul Little, Senior Programmer/Analyst
SVi Retail Systems
San Diego, CA


Quote:
> Hi,

> Thanks to Paul for his answer to my previous question about zero filling
the
> document_number field.  I also have to zero fill an amount
> field(document_amount), and I also have to remove the decimal point from
> this document_amount field, but keep the numbers which were to the right
of
> the decimal point.  When I zero fill the field before removing the
decimal,
> crystal removes the decimal point and the numbers to the right of the
> decimal as well.  I would like to remove the decimal point from the field,
> and then zero fill, but I can't figure out how to do it.  I'm new to
> Crystal,  and I have a feeling there's a very simple way to accomplish
> this(as there was in my previous question, where I was overcomplicating
it).

> Can anyone help?

> Thanks very much.

> Sue



Sun, 29 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. zero filling a field

2. Add Zero's to make two decimals.

3. Button for filling a fill-In field ? (Newbie)

4. Button for filling a fill-In field ? (Newbie)

5. Button for filling a fill In field ? (Newbie)

6. Dropping zeros after the decimal using Ccur()

7. Displaying zeroes after decimal point - eg $1.00

8. Filling leading zeros

9. Filling a combobox with decimal numbers

10. Auto-filling fields with previous fields' data

11. Fill field in one table from field in another table

12. TableDef/Set all text fields to allow zero length

 

 
Powered by phpBB® Forum Software