문제

I have an asp.net application in which i'd to display a double field in a crystal report.

I'd like to display ,for example, 11.22 as 11

I used the method Math.Truncate but i got this double 11,00 as result.

So how can i resolve this problem without converting it to an integer?

도움이 되었습니까?

해결책

Have you tried;

Math.Round(11.22)

That ought to do what you want although you need to be aware of the rounding rules.

다른 팁

Try this expression:

Math.Floor(11.22)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top