Results 1 to 5 of 5

Thread: Prevent integers from being rounded?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2011
    Posts
    28

    Prevent integers from being rounded?

    I have two textboxes that will contain numbers. I convert those text boxes to integers and then want to multiply them by certain values and then show the new value in a different textbox. For example, 100 gets converted to an integer and then multiplied by 1.75 and the value displayed in the other textbox is 200 instead of 175. How do I make it so the value isn't rounded to the nearest 100?

    Here is my code, compTotalPremium.Text and collTotalPremium.text are the boxes that are showing the rounded value.

    Code:
    Dim Comp As Integer = compDedPremium.Text
    Dim Coll As Integer = collDedPremium.Text
    Dim CompMulti As Integer = compDedMulti.Text
    Dim CollMulti As Integer = collDedMulti.Text
    
    compTotalPremium.Text = (Comp * CompMulti)
    collTotalPremium.Text = (Coll * CollMulti)
    Last edited by Boots13; Feb 15th, 2011 at 12:53 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width