Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How does c# make the received value display only the last two digits? Form and other forms show that the two digits don't show decimals after forming?
How does c# make the received value display only the last two digits? Form and other forms show that the two digits don't show decimals after forming?
Just write a function to judge this yourself!

Private? String? FormatNum(Double? Numbers)

{

Int? intNum=Int32。 Analysis (number. ToString());

if(intNum。 ToString()。 Length < = 2)

{

Return? intNum。 ToString();

}

Otherwise {

Return? intNum。 ToString()。 Substring (intNum. ToString(),intNum。 ToString()。 Length-2,2);

}

}