Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Number to text Decimal Places

Status
Not open for further replies.

Rachel30

Programmer
Mar 1, 2005
95
0
0
GB
Hi,

I am trying to convert a number field to text how do I make sure it does not display with decimal at the moment it is displaying 1.00 I would like to display 1. Thanks Rachel
 
Right click on the field and click on format object. From the number tab, click on Customize and make change the decimal and rounding to 1.

-LW
 
LW,

Thanks for your answer however I am using the number in a formula in text string so for example I want to say

"Policy Holder = " + " " + Totext(PolicyHolder)

Thanks

Rachel
 
the totext function will take a parameter of decimal places, so do totext(policyholder, 0) to get no decimals.
 
This just came up in another CR forum (Crystal_Users@yahoogroups.com). Here is the thread, in chronological order:

> On Mon, 2005-05-02 at 08:01 -0700, Justin Jones wrote:
> > I have a formula where I am trying to change the format of the field to
> > remove the standard two decimals. I am drawing a Monday morning brain
> > lapse on how to do this. Any help I appreciated.
> >
> >
> >
> > {Item.Quantity} & "@" & {Item.Price} displays 10.00 @ $15.00 and I want
> > it to display as 10 @ $15.00
> >
> >
> >
> > Thank you.
> >
> >
> >
--- In Crystal_Users@yahoogroups.com, Costas Piliotis <cpiliotis@s...>
wrote:
> Personally I don't usually use a formula for simple concatenation
> stuff... Many people don't realize that you can just drop a field onto
> a text box because many people come from MS Access Reports that don't
> have this feature. You might already know this, but just in case:
>
> I would create a text field with " @ " inside of it. Then drag the db
> field somewhere on your report, format it, and then drag it into the
> text box afterwards. IMO that's one of the ultra coolest features of
> CR.
>
> (OTOH if you're doing anything more, I too have a brain fart this
> morning haha and can't remember the function either)
>
In my opinion, the brain fart is in Crystal. Your formula field is a
string, so you can't just format it; you have to format the components
of the string: {Item.Quantity}. Supposebly, truncate(x) will get rid
of the decimal point and trailing zeros, but it don' seema work inside
a formula. (Can anybody say "bug".)

I finally got it to work with ...

Replace (ToText ({FIN_FISCAL_YEARS.FISCAL_YEAR}), ".00", "") & " @ " &
{FIN_FISCAL_YEARS.CLOSING_STATUS}

Maybe Costas has the better approach.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top