Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Location
    CHINA Taiwan
    Posts
    3

    Unanswered: Divide Problem, I want code doing no round for me

    well,
    #---
    define i decimal(4,1),
    j smallint,
    k smallint,

    Let i = 172
    Let j=i/60
    Let k = i mod 60
    #---
    k has no problem here...

    So, my j is going to be 3
    But I wished it to be 2
    this is a serious question when I make 172 minutes to be 2(j)hours and (k) minutes

    I thinked a lot and there is no way out...
    How to solve this, PLEASE.

  2. #2
    Join Date
    May 2004
    Location
    Barcelona, Spain
    Posts
    54
    two ways:

    Let i = 172
    Let j=TRUNC(i/60)
    Let k = i mod 60


    Let i = 172
    Let k = i mod 60
    Let j=(i-k)/60

    cheers

  3. #3
    Join Date
    May 2004
    Location
    CHINA Taiwan
    Posts
    3
    Thank you, I watched your post finally found I asked a question I never thought that answer, my brain is slow....
    I am a newbie and asked a newbie question.
    I like the second way, so people may know what i want to explain.

    Thanks again.

Posting Permissions

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