I am working on a calculator in Visual Studio 2019 and I have had a problem. I need to multiply a variable value (let's call it X) by a constant one (let's call it Y = 400). The value X is obtained after doing another mathematical operation, but it shows an exaggerated number of decimal places that when multiplying by Y is incorrect.
Suppose I get X = 1.47857142857143. I only need the first 2 decimals (.47) and whatever integer that results.
Incorrect result: 1.47857142857143 * 400 = 591.4285
Correct result: 1.47 * 400 = 588.
As final data: 1.- I have to use the result for other operations; so hiding it with the margins of the label or the textbox does not work for me. 2.-I only have knowledge of the C++ language and using C#, but many years have passed since I used them, so I would appreciate it if the answers were as detailed as possible.