How to truncate the Decimal/integer value
C#
2
Posts
2
Posters
0
Views
1
Watching
-
Hi friends, I am new to C# so i have doubt..I am geeting 8 digit EmployeeID,i want to truncte those Eight digits into four digits ..How it could be possible to implement. Regards, Jeyakrishnan
-
Hi friends, I am new to C# so i have doubt..I am geeting 8 digit EmployeeID,i want to truncte those Eight digits into four digits ..How it could be possible to implement. Regards, Jeyakrishnan
If your id is int or long:
int firstPart = id / 10000; int secondPart = id % 10000;
If it's a string, use the SubString method.