Problem dividing two numbers

I am having a problem dividing two numbers. When I divide 150 / 50, I get the answer 3. But when I divide 50 / 150 , I get zero. Can anyone please help with this issue. I am using FastReport.NET

Comments

  • edited 9:28PM
    You are using integer division. So even if you are assigning the result to a datatype for a decimal value, it will be an integer. Try casting one of the values to a double or decimal and you will get the expected result.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.