if you are using C++, and you want to keep two decimal place, you can use the attribute of (float to int precision loss). And the codes seem easy enough to understand right?