BusinessObjects Board

Display tiled symbol when more then 2 decimal places

Hello Team,
My requirement is to display the Tiled symbol when a number contains more than 2 decimal places. In our case, we may get up to 14 decimal places. When we try in crystal reports it supports up to 10 decimal places while we convert the number to totext. Please let us know if we have any alternate solutions to this problem.
Ex:
Test=123.45677888888834
want to display the above text as
Test=123.45~

Thanks
Chakradhar


chakradhar (BOB member since 2018-12-27)

I am not sure if this would work in you situation. But maybe a variation of it would. I am assuming that if the number has trailing zeros, you just want to see the first two digits. The number variable i would be replaced by your field.

numbervar i := 22/7.0;

stringvar j := totext(i, 10,’’);
if right(j, 8) <> ‘00000000’ then
left(j, len(j)-8) +’~’
else left(j, len(j)-8)


kevlray :us: (BOB member since 2010-06-23)

CHAR(126) will give you what you want. Use this piece in your else statement.


anil.ganga1 :us: (BOB member since 2007-07-04)

I would do this slightly differently:

StringVar Dec2 = ToText({MyTable.MyField}, 2, ‘’);
If ToNumber(Dec2) <> {MyTable.MyField} then
Dec2 + ‘~’
else
Dec2;

-Dell


hilfy :us: (BOB member since 2007-04-16)