Msdn does not provide a detailed description. An example is provided;
Math. Round (3.44, 1); // returns 3.4.math.round (3.45, 1); // returns 3.4.math.round (3.46, 1); // returns 3.5.
According to his example, the result is "five homes and six inputs". I changed the number and the result will be completely changed.
Math. Round (3.445, 1); // returns 3.4.
Math. Round (3.455, 1); // returns 3.5.
Math. Round (3.465, 1); // returns 3.5.
Math. Round (3.450, 1); // returns 3.4. (adding 0 is invalid)
Math. Round (3.4452, 2); // returns 3.45.
Math. Round (3.4552, 2); // returns 3.46.
Math. Round (3.4652, 2); // returns 3.47.
A:
Many countries in the world have widely adopted the "four homes and six access method ". The National Science and Technology Commission of China made a recommendation in 1955. The "four homes, six homes, and six homes" can be summarized as follows: "four homes, six homes, six homes, five homes, six homes, and five homes, six homes, five homes, six homes, six homes, five homes, six homes, five homes, before five, it is odd to enter one."
A:
In the field of engineering, finance, and science, we often think that it is more accurate to round a decimal point to the nearest even number (rather than always round it up, that is, the "four homes and six inputs" method we call here.
Math. Round () method used by bankerAlgorithmIs based on the IEEE Standard 754 international standard.
it is said that all European banks adopt this model.
I don't know about this. Round handles this in five-to-five pairs.
I also encountered this problem. It was also strange at first, and later I Came To See help. It was really a couple of four homes, six homes, five meals, although the four homes and six entrances mentioned above are international standards, many business systems in China still adopt a rounding approach. No way, I have to write a method to rounding them. However, there is a good method on the Internet. Although it may be tricky, there is usually no problem, that is, add 0.0000000001 to the back, a small number, and then take two more, three or four digits are okay. Try it