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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem of comma

Status
Not open for further replies.

joe69008

Programmer
Jun 29, 2005
42
FR
Hi everybody,
Small question please, I have one fields unit price which is formated in 5 decimals in the ERP on which i worked : XXX, XXXXX All the prices thus appear in this way:
12,90000 or 0,01230 or 1123,382000
Thus in crystal, I selectionne fields shaping - > number - > personalized and in decimal I put 100000 and in roundness me puts 0,00001.

Only Here we are, when the price is 12,90000, I would want only posted 12,90, or when it is 1123,382000, posted 23,382.

I think that it would be necessary to go to the editor of formula which there is in quoted by decimal and rounded off but I do not really know what to write inside.

If somebody could help me please, that would be really nice.

i worked on Crystal report 10 and on Oracle database
Only.

thanks
 
Please show how you would want the following to post:

12,34560
12,00000
12,23000
12,12350
12,10000

-LB
 
I'll take a guess here. If you are trying to trim only zeros, but only down to two decimal places, then in the numbers->customize tab->decimals->x+2 enter:

if val(right(totext({table.price},5),5)) = 0 then 2 else
if val(right(totext({table.price},5),4)) = 0 then 2 else
if val(right(totext({table.price},5),3)) = 0 then 2 else
if val(right(totext({table.price},5),2)) = 0 then 3 else
if val(right(totext({table.price},5),1)) = 0 then 4 else 5

This would return the following using my earlier example:

12,3456
12,00
12,23
12,1235
12,10

In other words, it removes extra zeros until there are two decimals left.

-LB
 
that exactly what i want, thanks you very much man.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top