Results 1 to 3 of 3

Thread: Single subtraction

  1. #1

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433

    Question Single subtraction

    Hey All,

    Code:
    MK=1.2949;
    
    txtSL.Text = Convert.ToString(MK-0.0020);
    Why does this give me an answer of "1.29289994049072" and not "1.2929"?

    MK is of type "Single".

    TIA.

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    try:
    MK=1.2949;

    txtSL.Text = Convert.ToString(MK- (single)0.0020);
    \m/\m/

  3. #3

    Thread Starter
    Hyperactive Member Dodger's Avatar
    Join Date
    Mar 2001
    Posts
    433
    Thanks!

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