Hi
I have below code cast(ZZ.U_No_of_Box as numeric(19,0)) and value is displayed as 19.00.
I want only 19. Decimal part should not be printed
Thanks
Hi
I have below code cast(ZZ.U_No_of_Box as numeric(19,0)) and value is displayed as 19.00.
I want only 19. Decimal part should not be printed
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Nov 12, 2023, 2:11 AM
The documentation of the double struct is at:
Double Struct (System) | Microsoft Learn
https://learn.microsoft.com/en-us/dotnet/api/system.double?view=net-7.0
There are Floor and Round static methods. When you use a cast, and when you use the Flour method, the decimal portion is discarded. The Round method will round (up or down). The following:
Code Snippet
Produces:
Data: 19.03; Cast: 19; floor: 19; round: 19
Data: 19.97; Cast: 19; floor: 19; round: 20
Note that Round works differently than the others.
Khoday AkileshPosted Nov 11, 2023, 5:07 AM