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

 Page 1 of 1 [ 2 post ]

Relevant Pages