I'm using decimal to make and Physic calculator but I've noticed it keeps the finals 0's without taking out 0's in midle or being or before the "," of the result. For example:
275 M/s to KM/h
The Result is 990.
But the program shows 990,0.
I want make it show 990 instead of 990,0.
Loading
Sergio FonsecaPosted Apr 17, 2008, 6:24 PM
I need it to detect how much length it gotta remova. I think I know a way on how to do so now. I'll try with this one I just though:
while (string.EndsWith == "0")
{
string.Length = string.Length - 1;
}
if (string.EndsWith == ",")
string.Length = string.Length - 1;
Thank you for your help.
Niradhip ChakrabortyPosted Apr 17, 2008, 4:23 PM
U want 990 instead of 990,0.
So u want to remove last two characters,i.e " ," and "0". Take a string say msg and assign the value into it and then use the following code
string msg =null;(assign the value here) string msgnew=msg.Substring(0,msg.Length-2);