Hello all,
I need to force a number to round and then display the integer.
right now the number looks like this:
Ident Hours
1 40
2 40.25
3 40.15
4 40.56
I need the number to look like this
Ident Hours
1 40
2 40
3 40
4 41
is there an easy way to do this?
I am using Crystal V. 8.5. I will be incorperating this number into this code
this formula forces the number to look like this:
ident Hours
1 0040
2 4025
3 4015
4 4056
end results need to be:
ident Hours
1 0040
2 0040
3 0040
4 0041
I need to force a number to round and then display the integer.
right now the number looks like this:
Ident Hours
1 40
2 40.25
3 40.15
4 40.56
I need the number to look like this
Ident Hours
1 40
2 40
3 40
4 41
is there an easy way to do this?
I am using Crystal V. 8.5. I will be incorperating this number into this code
Code:
numbervar reqlength := 4;
numbervar currlength := if not isnull({mytable.myfield}) then length(totext({mytable.myfield}*1000,"0000"));
stringvar YTDHrs := if not isnull({mytable.myfield}) then totext({mytable.myfield}*1000,"0000");
if currlength > reqlength then
YTDHrs := YTDHrs[1 to reqlength]
else
YTDHrs := replicatestring("0", (reqlength - currlength)) + YTDHrs;
YTDHrs;
this formula forces the number to look like this:
ident Hours
1 0040
2 4025
3 4015
4 4056
end results need to be:
ident Hours
1 0040
2 0040
3 0040
4 0041