Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Location
    India
    Posts
    11

    Post Unanswered: Rounding off to Highest 5 and Highest 1

    Hi ,

    1) I want to round off a decimal number to its highest multiple of 5
    eg. 55.31 should be printed as 55.35
    55.33 should be printed as 55.35
    55.76 should be printed as 55.80
    55.79 should be printed as 55.80

    2) I want to round off a decimal number to its highest 1
    eg. 55.33 should be printed as 56
    55.76 should be printed as 56

    Can anyone suggest sql queries to solve the above.

    Thanks in advance,
    Sam

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Rounding off to Highest 5 and Highest 1

    Originally posted by sammydude
    Hi ,

    1) I want to round off a decimal number to its highest multiple of 5
    eg. 55.31 should be printed as 55.35
    55.33 should be printed as 55.35
    55.76 should be printed as 55.80
    55.79 should be printed as 55.80

    2) I want to round off a decimal number to its highest 1
    eg. 55.33 should be printed as 56
    55.76 should be printed as 56

    Can anyone suggest sql queries to solve the above.

    Thanks in advance,
    Sam
    1) CEIL( x*20 )/20

    2) CEIL( x )

  3. #3
    Join Date
    Feb 2002
    Location
    India
    Posts
    11
    Thanks Andrew. You've been a great help.

    Regards,
    Sam

Posting Permissions

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